Have you made a booboo by checking in something which you shouldn’t have? If you are using TFS and TFS Power Tools (tfpt in short) installed on your system, you are still good to roll the s#%t back.
Here are the steps that you will need to follow:
1. Install
TFS Power Tool. This is recommended as it provides a lot of goodies without which you may see hell some day.
2. ‘Shelve’ all changes, as you will have to ‘undo’ all your changes.
3. Open cmd prompt. Make sure your $path environment variable is configured to find tfpt.exe
4. Change directory to the workspace
5. Give this command: rollback /changeset:{Change-Set Number}
(For example rollback /changeset:39356)
6. It will take latest of all your workspace. This is what I don’t like as it doesn’t work otherwise. It takes some but works…
7. After above step, tfpt has taken older version and all those file will be ready to be check-in with older viersion.. Check-in those and take a tea.
Tip [02/24/2009]: Step 6 may kill you if you are storing huge amount of data into TFS. I advice you to create a new workspace with only required files downloaded. For Example, if your all changes are in '$codebase/folder/subfolder/" then create workspace for $codebase/folder/subfolder/ mapped to local directory C:\for_rollback\ Due to this, step 6 will become very fast.
Powertool help and website:
http://msdn.microsoft.com/en-us/tfs2008/bb980963.aspx