Welcome to MSDN Blogs Sign in | Join | Help

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
Published Monday, March 06, 2006 7:29 PM by Richard Murillo

Comments

# How to Unlock a File in Team Foundation Server

Monday, March 06, 2006 3:45 PM by Technical Weblog of Eric Charran
We've all been in the situation before when a developer goes away for a long weekend (usually leaving...

# http://blogs.msdn.com/echarran/archive/2006/03/06/544745.aspx

Monday, March 06, 2006 9:46 PM by TrackBack

# How to undo another users check out in Team System Source Control

Tuesday, November 07, 2006 7:13 PM by Peterson's Ponderings

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

# Undo check out in TFS

Monday, October 01, 2007 3:45 PM by Jowen

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

# Remember to check-in when you re-format your machine!!!

Tuesday, May 12, 2009 10:20 AM by Joel Varty

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

New Comments to this post are disabled
 
Page view tracker