Home > Uncategorized > Rollback Changeset in TFS 2010

Rollback Changeset in TFS 2010

Recently, I got a requirement to rollback changeset from TFS 2010. I referred some articles in the net. Below are some of them

http://msdn.microsoft.com/en-us/library/dd380776.aspx
http://geekswithblogs.net/TarunArora/archive/2011/06/27/how-to-undo-a-changeset-using-tf.exe-rollback.aspx

Here I want to summarize the steps to rollback change sets in TFS 2010.

As described in above links, TF is a TFS command line tool available in “C:\ProgramFiles\Microsoft Visual Studio 10.0\Common7\IDE”. There are several arguments we pass to it. Among them /Changeset and /toVersion are mostly used arguments.

/Changeset
Syntax: tf rollback /changeset:C<n> <TFS BranchPath> /r — where <n> is the changeset number
How it works?: Removes the changes done as part of the <n> changeset.

/toVersion

Syntax: tf rollback /toVersion:C<n> <TFS Branch Path> /r –where <n> is the changeset number
How it works?: This will remove the changes done by all changesets after thespecified changeset.

For example, if you have change sets 1, 2, 3, 4. The command “tf rollback/changeset:C4” will remove the changes of Changeset 4. The command
“tf rollback /toVersion:C2” will remove the changes of Changesets 3,4 and leaves the at change set#2.

Points to remember:

  1. TFS Branch Path should
    be path to the branch ex: $/project/applicaitonFolder/branchFolder
  2. You need to run this TF command from the workspace folder.
  3. Open VS 2010 command prompt
  4. Go to the branch folder in your local disk
    Ex: D:\project\applicaitonFolder\branchFolder>tf rollback /toVersion:C123
    $/project/applicaitonFolder/branchFolder /r

On successful execution of TF Rollback, files will be checked-out in your workspace. You can check-in them to complete the rollback.

 

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: