How to: Roll Back a Changeset
If you accidentally check in changes or accidentally delete files, you can correct these mistakes. You can revert to an earlier version of a file for which you checked in changes, or you can restore a file that you deleted.
To perform these procedures, your Check out permission must be set to Allow. For more information, see Team Foundation Server Permissions.
To revert to an earlier version of a file
In Source Control Explorer, right-click the file that you want to roll back, and then click Get specific version.
The Get dialog box appears.
Under Type, click Changeset.
Under Changeset, click the ellipses (…).
In the Find Changesets dialog box, either use the default values or specify criteria for your search, and then click Find.
Under Results, click the changeset that contains the version to which you want to revert the file, and then click OK.
In the Get dialog box, select the Overwrite writable files that are not checked out check box, and then click Get.
The earlier version of the file is copied to your local working folder.
In Source Control Explorer, right-click the file, and then click Check Out for Edit.
In the Check Out dialog box, click Check Out.
In Source Control Explorer, right-click the file again, and then click Check In Pending Changes.
In the Check In - Source Files dialog box, click the file, and then click Check in.
The Resolve Conflicts dialog box appears, and a message explains that no files have been checked in because the two versions have changes that conflict.
In the message box, click OK.
The Pending Changes – Conflicts window appears.
(Optional) In the toolbar of the Pending Changes window, click Compare Local to Server.
The server and local copies appear side by side so that you can review your decision before you roll back the changes
In the Pending Changes window, click Keep Local Version.
In Source Control Explorer, right-click the file, and then click Check In Pending Changes.
In the Check In - Source Files dialog box, click Check in.
To restore previously deleted files
On the Tools menu, click Options, click Source Control, and then click Visual Studio Team Foundation Server.
Select the Show deleted items in the Source Control Explorer check box.
In Source Control Explorer, right-click the deleted file, and then click Undelete.
Right-click the file again, and then click Check in Pending Changes.
In the Check In dialog box, select the check boxes for any files that you want to restore, and then click Check In.