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.
Exellent tips, saved me some work today.
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.?
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.
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.