Undo changes in another user's workspace

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Visual Studio 2019 | Visual Studio 2022

Occasionally a team member is blocked from checking in a file that someone else has locked. You can use Team Foundation Version Control (TFVC) commands in this situation:

  • To delete pending changes in another user's workspace, use the tf undo command.
  • To remove an exclusive lock on a file but not the pending changes, use the tf lock command. For more information, see Lock command.
  • To delete another user's workspace, use the tf workspace command. For more information, see Remove a workspace.

Prerequisites

To undo pending changes in another user's workspace, you must have the Administer workspaces permission set to Allow. For more information, see Default TFVC permissions.

Undo the changes in another user's workspace

  1. Open Developer Command Prompt for your version of Visual Studio.

  2. Enter the following command at the command prompt. Replace the arguments with values that are appropriate for your needs.

    tf undo /workspace:<other-user-workspace>;<other-user> $/<project-path>/<file-name> /collection:<team-project-collection-url>

    For example, you might enter the following command:

    tf undo /workspace:OtherUserWorkspace;OtherUser $/TeamProject/MyFile.cs /collection:https://YourTFSServer:8080/tfs/YourCollection

For more information, see Undo command.