Undo checkout or lock by another user


Scenario: Another user has locked a file for checkout, but is no longer available to check the file back in and now you need that file.
 
Unlocking the file
 
First you will need to get a list of the workspaces for that user. This can be done with administrative rights from the command line as follows:
 
tf workspaces /owner:DOMAIN\TheirUserAccount /computer:*
 
The command will retrieve a list of all workspaces on all computers for that user.
 
You can now use the output information to undo the checkouts on the files you want:
 
tf undo /workspace:TheirWorkspace;DOMAIN\TheirUserAccount $/path/to/file
 
In the event the developer is no longer with the company or on the project, you can also delete the workspace which will also undo any pending changes using the following command:
 
tf workspace /delete TheirWorkspace;DOMAIN\TheirUserAccount /s:http://TFSSERVER:8080
Comments (5)
  1. Joel Varty says:

    Besides losing any code you may have written that you’ll never get back, those pending changes or locks

  2. Jowen says:

    Het is mogelijk om de checkout van een file te undo'en (met genoeg rechten uiteraard) dit is handig

  3. I recently ran into the problem where I needed to rename some folders in source control of my team system…

  4. We’ve all been in the situation before when a developer goes away for a long weekend (usually leaving…

Comments are closed.

Skip to main content