TFS: Undo another user’s check-out files

In order to undo files that are checked-out by another user, you can use the TF.EXE command-line tool:

tf undo [/workspace:workspacename[;workspaceowner]] [/recursive] itemspec [/noprompt] [/login:username,[password]] [/collection:TeamProjectCollectionUrl]

For example:

tf undo /workspace:MyWorkspace;DOMAIN\Itay /recursive *.* /collection:TeamProject

You can find the TF.EXE tool in the following locations:

  • For TFS 2008: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe
  • For TFS 2010: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe