Undo user checkout in tfs

Many ways have been done by me, but nothing for the result. Just only because of a user forgets to check in his working in TFS server, everything getting wrong every updates the file. That user must check in it, but he has been resigned. Try to use his account by asking his password from Visual Studio connects TFS, again failed, also has been used Administrator account.

Must be there is a way to solve this. After searching some thing with key word “tfs undo” in google, finally find the article from msdn which can help me to solve the problem. It is using command prompt utility of Visual Studio. It is a cool command and problem solved.

  1. Click Start, click All Programs, click Microsoft Visual Studio 2008, click Visual Studio Tools, and then click Visual Studio Command Prompt.
  2. Type the following command and replace the arguments with the appropriate parameter information for your needs:
    tf undo [/workspace:workspacename[;workspaceowner]] 
    [/server:servername] [/recursive] itemspec [/noprompt]
  3. Example c:\projects>tf undo /workspace:WS_Juan;Ivan $/math/271.cs

Command detail, please read this reference : http://msdn.microsoft.com/en-us/library/c72skhw4(v=vs.90).aspx.

My result:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>tf undo /workspace:XXX; $/PROJECT.WO2/PROJECT.WO2/PROJECT.WO2.WEB/DDSReport/ExportToExcel.aspx.cs The operation completed successfully. Because the workspace XXX;DOMAIN\xxx is not on this computer, you must perform a separate get operation in that workspace to update it with the changes that have been made on the server.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>

undo tfs