Rollback a changeset in tfs

101,522

Solution 1

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

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.

Share:
101,522
Admin
Author by

Admin

Updated on August 09, 2020

Comments

  • Admin
    Admin almost 4 years

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

  • Shimmy Weitzhandler
    Shimmy Weitzhandler about 11 years
    Please help me clarify something, when I select in the explorer an old changeset and then click 'rollback', does it rollback to that changeset or to one before??
  • James Reed
    James Reed about 11 years
    It rolls back the changeset you have selected to the previous one.
  • Quality Catalyst
    Quality Catalyst over 9 years
    This is not a rollback. This is a check-in.
  • Fery
    Fery about 9 years
    It is not just check in @QualityCatalyst. When you roll back change set X, if you want to save the undoing, after rolling back, you should check in to have the solution without changes in change set X.
  • Quality Catalyst
    Quality Catalyst about 9 years
    @Fery, you are right. The answer here though does not talk about a rollback. It talks about a pure check-in based on historic code.
  • Fery
    Fery about 9 years
    @QualityCatalyst yeah , you are right. Today I just release for rolling back you can not get a version and then check in, you must roll back a/ to change set then check in.
  • Tauseef
    Tauseef over 8 years
    Means any changes after that change set would also be removed? If we are talking about full project and changes are in different files in different change sets?
  • krzyski
    krzyski over 7 years
    In VS 2015, when I select single changeset, I can rollback changes on all files, that were affected by this changeset (by single click). When I select multiple changesets, I can rollback changes just on the file I've selected. What I'm doing wrong?
  • Mr.Curious
    Mr.Curious almost 3 years
    How to rollback only specific files in a changeset and not entire changeset? Is there a way or shd i get specific dates version of the files i want(Is the only way) ?