tfs: how to unlock changes

Jeremy picture Jeremy · Apr 12, 2011 · Viewed 15.5k times · Source

I originally edited a file, which did a checkout. I received a new computer, and now I want to edit the file. I don't care about the original edit.

TFS reports that another user has an exclusive lock on the file. It's not actually another user, it's me, but the machine is different, so the workspace is different.

I tried unlocking with the tf commandline using the following command:

tf lock /lock:none /workspace:oldmachinename;domain\me /recursive $/projectname/directory /s:http:tfs:8080/tfs/project

I get no errors, but when I go into Visual studio 2010 (We're using tfs 2010 as well) The files remain locked.

What am I doing wrong?

Answer

AaronS picture AaronS · Apr 12, 2011

Have you tried using TFS powertools?

Once you have that, you can right-click on your folder or file, and choose Find in Source Control -> Status. After you click Find, it should show you all the check-outs, or files that are checked-out

You should then be able to right-click on the checkout and choose "Undo..".

While this is generally issuing the same command line arguments, I've had good luck with it.