Undoing Pending Changes from Another User in TFS

From time to time, we run into a situation where a team member leaves or becomes unavailable, but they still have files checked out in TFS. This can be troublesome if they have an exclusive lock on a file, or it can be a housekeeping issue if they have a lot of files checked out everywhere.

If you have rights, there is a relatively simple way to undo changes from another user to clean-up a bit.

First, you need to know the name of the user’s workspace(s). You can do this by running the following command:

tf workspaces /owner:"username" /server:http://tfsserver:8080/collection

Then, to undo all pending changes from a particular workspace, run this command:

tf undo /workspace:"WORKSPACE;username" /server:http://tfsserver:8080/collection /recursive "$/teamproject"

If successful, you should receive a message like this:

The operation completed successfully.  Because the workspace xxxx;xxxxxxxx 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.

Reference: here.

About these ads

One thought on “Undoing Pending Changes from Another User in TFS

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s