Rollback a changeset in tfs

Visual StudioTfsVisual Studio-2012

Visual Studio Problem Overview


Using visual studio 2012 and TFS 2012, I would like to rollback a changeset to the prior one.

Visual Studio Solutions


Solution 1 - Visual Studio

In TFS 2012,

  1. View the history of the thing you want to rollback.
  2. Select the changeset you want to roll back.
  3. Right click on the changset and choose "Rollback".
  4. Check that the pending changes are correct (the rollback command will revert the entire changeset not just the file you selected)
  5. Check in.

In TFS 2010, you can call the tf rollback command from a visual studio command prompt, or you can install the TFS power tools and use the same process as above

Solution 2 - Visual Studio

In TFS / Visual Studio 2012, you have a few options.

Rollback to a specific version

In Source Control Explorer:

  • Right Click the branch you wish to roll back
  • Click Rollback...
  • Choose Rollback to a specific version
  • Enter the changeset number you wish to roll back to.

Rollback a single changeset (you can do this through the dialog loaded above too)

  • Right click the changeset you wish to rollback
  • Choose Rollback entire changset

Checkin the rollback.

Solution 3 - Visual Studio

I have never worked with TFS 2012 but this works in 2010

Get specific version and pick the version you want to roll-back to and then check in that code again.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1108948View Question on Stackoverflow
Solution 1 - Visual StudioJames ReedView Answer on Stackoverflow
Solution 2 - Visual StudiogregpakesView Answer on Stackoverflow
Solution 3 - Visual StudioBjörn MårtenssonView Answer on Stackoverflow