Visual Studio Team System
How to: Roll Back a Changeset

Though a changeset is a permanent part of the record and technically cannot be undone or removed, you can use the following procedure to effectively roll back a changeset. This procedure is a common way of correcting a check-in mistake.

ms194956.alert_note(en-us,VS.90).gifNote:

The following steps refer to file in singular, but the process is the same for a group of files.

Required Permissions

To perform these procedures, you must have the Check out permission set to Allow. For more information, see Team Foundation Server Permissions.

To revert to a prior version of the file

  1. In Source Control Explorer, right-click the file whose changeset you want to roll back, and then click Get specific version on the context menu.

  2. In the Get dialog box, select the prior version of the file, and then click Get. For more information, see How to: Retrieve Old Versions of Files from Changesets.

  3. After this file is in your workspace, right-click the file, and then click Check Out for Edit on the context menu.

  4. Right-click the file again, and then click Check In Pending Changes.

  5. In the Check In - Source Files dialog box, select the file, and then click Check in.

    The Resolve Conflicts dialog box appears.

  6. Click Resolve to open the Resolve version conflict dialog box.

  7. Click Discard server changes.

  8. Click OK.

    ms194956.alert_note(en-us,VS.90).gifNote:

    To review your decision before discarding the server changes, you can click Compare to view the server and local copies simultaneously.

  9. In the Resolve Conflicts dialog box, click Close.

  10. In Source Control Explorer, right-click the file, and then click Check In Pending Changes.

  11. In the Check In - Source Files dialog box, click Check in.

See Also

Concepts

Other Resources

Tags :


Community Content

digger69
VS2008 and Get Latest on Checkout

Step #3 assumes your Checkout for Edit won't get latest version, ovewriting the prior version you just got. However, in VS2008 there is both a client setting (Tools: Options: Source Control: VSTFS: Get lastet version on check out) and a TFS Project level setting (Rightclick the project in Team Explorer -> TP Settings -> Source Control). If the TFS project is set to get latest on checkout, it will, even if the client setting is turned off. Assuming your admin won't let you change the TFS project level setting, you will have to do the get at a command prompt after you checkout for edit.

tf edit myfile.cs
tf view mfile.cs /version:cnnnn > myfile.cs
tf checkin myfile.cs

thanks Mr. Berg for helping me find this over on TFS forums.

Tags : contentbug

Page view tracker