The Problem

Another user has locked a file for checkout, but is no longer available to check the file back in and now you need that file.

Unlocking the file

First you will need to get a list of the workspaces for that user. This can be done with administrative rights from the command line as follows:

tf workspaces /owner:DOMAIN\TheirUserAccount /computer:*

The command will retrieve a list of all workspaces on all computers for that user.
You can now use the output information to undo the checkouts on the files you want:

tf undo /workspace:TheirWorkspace;DOMAIN\TheirUserAccount $/path/to/file

In the event the developer is no longer with the company or on the project, you can also delete the workspace which will also undo any pending changes using the following command:

tf workspace /delete TheirWorkspace;DOMAIN\TheirUserAccount /s:http://TFSSERVER:8080
tf undo [/workspace:workspacename[;workspaceowner]] [/server:servername] [/recursive] itemspec [/noprompt]

I was also faced with having to add my login info, so the exact command I used was as follows:

tf undo /workspace:WORKSPACE-NAME;User $/myProject/CheckedOutFile.cs /login:myusername,mypassword

I also found out that you can delete an entire workspace for a developer who is no longer on your project and maybe had some files checked out. That command is even easier, and will automatically undo any checkouts:

tf workspace /delete Workspace (add "/login:name,password" to end of command if not using AD)