tags:

views:

1275

answers:

3

As the resident TFS admin, on occasion I am asked to undo a checkout (usually a lock) that a user has on a certain file checked into source control.

How do you undo another user's checkout?

+5  A: 

The easiest way I found is to use TFS Sidekick application (free). It has an option to view and undo other user's checkout.

Marek Karbarz
+1; http://www.attrice.info/cm/tfs/
SomeMiscGuy
+3  A: 

There are at least 2 different ways to do this:

Command Line

There is a command-line utility called Tf.exe that comes with Team Explorer. Find the documentation here. It can be accessed by launching a Visual Studio Command Prompt window. The syntax of the command is:

tf undo [/workspace:workspacename[;workspaceowner]] 
[/server:servername] [/recursive] itemspec [/noprompt]

Example: tf undo /workspace:noxad_ws;noxad $/project/abc.cs

GUI

The second is via the GUI, but does not come standard - you have to install the TFS Power Tools. See here for details on how to use this method.

Keep in mind that with either method you will need the appropriate rights. The permissions are called "Undo other users' changes" and "Unlock other users' changes". These permission can be viewed by:

  1. Right-clicking the desired project, folder, or file in Source Control Explorer
  2. Select Properties
  3. Select the Security tab
  4. Select the appropriate user or group in the Users and Groups section at the top
  5. View the "Permissions for [user/group]:" section at the bottom
brett rogers
A: 

Is there a way to leverage the tf undo command from the TFS SDK ? (This is so that I can integrate some functionality in one of the IDE integrations)

Looneystar