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.

Advertisement

Author: Adam Prescott

I'm enthusiastic and passionate about creating intuitive, great-looking software. I strive to find the simplest solutions to complex problems, and I embrace agile principles and test-driven development.

4 thoughts on “Undoing Pending Changes from Another User in TFS”

  1. hi. what’s that mean: 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.?

    1. When I did first time, the undo operation did not work when select multiple files, I had many files qith differents extentions, and I thinked was necessary do anything else. It worked when I reduced number files to un check out. Please ignore previous question. Thanks.

  2. When I did first time, the undo operation did not work when select multiple files, I had many files qith differents extentions, and I thinked was necessary do anything else. It worked when I reduced number files to un check out. Please ignore previous question. Thanks.

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: