Rolling back changes on Team Foundation Server

Once in a while someone checks in some file they didn’t want checked in.

You can roll back these changes/checkins by using the Team Foundation Server Power Toy.

Team Foundation Server Power Tool Commands

Team Foundation Server Power Tool (tfpt.exe) is a command-line tool. To use these commands, start tfpt.exe at the Command Prompt. Some of the commands will display a graphical user interface when used. In addition, you can access the Annotate and Treediff commands from Source Control Explorer in Visual Studio or Team Explorer. Team Foundation Server Power Tool includes the following commands:

Unshelve Command
Use the unshelve command to unshelve and merge the changes in the workspace.

Rollback Command
Use the rollback command to roll back changes that have already been committed to Team Foundation Server.

Online Command
Use the online command to create pending edits on writable files that do not have pending edits.

GetCS Command
Use the GetCS (Get Changeset) command to get the changes in a particular changeset.

UU Command
Use the UU (Undo Unchanged) command to undo unchanged files, including adds, edits, and deletes.

Annotate Command
Use the annotate command to download all versions of the specified files and show information about when and who changed each line in the file.

Review Command
Use the review command to optimize the code review process to avoid checking in or shelving.

History Command
Use the history command to display the revision history for one or more files and folders. The /followbranches option returns the history of the file branch’s ancestors.

Workitem Command
Use the workitem command to create, update, or view work items.

Query Command
Use the query command to run a work item query and display the results. If you do not provide a specific query, all the active work items assigned to you are displayed.

TreeDiff Command
Use the treediff command to display a visual representation of the differences between files in two server folders, in a server folder and a local folder, or in two local folders.

Treeclean Command
Use the treeclean command to view and optionally delete files that are not under source control in the current directory and all subdirectories. This command is useful when you want to remove temporary files from your local workspace, such as files created by the compiler.


To use it for rollbacks, just add the install path to the tfpt.exe to your PATH environment variable.  Then, browse to the root of the project directory that you want to perform a rollback in and run “tfpt rollback” from the command line.

It will give you a user interface where you can find search for a chance-set to rollback.

Once you do it, you may have to “check in” the changes you just made, but I have used this several times and it has worked great.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s