Delen via


How to: Undo Pending Changes

Team Foundation source control functionality is easily manipulated within the Visual Studio environment. The following procedures describe how to undo pending changes from Source Control Explorer and from the command line using the Undo Command.

Required Permissions

To perform these procedures, you must own the workspace or have the Undo other user's changes permission set to Allow. For more information, see Team Foundation Server Permissions.

To undo pending changes in Source Control Explorer

  1. In Source Control Explorer, navigate in the Folders list to find the folder associated with the items for which you want to undo pending changes.

  2. In the lists of items to the right of the Folders section, use the Pending Change column and status icons to identify the file or folder for which you want to undo pending changes. For more information, see How to: Identify Source Control Item Status in Source Control Explorer.

  3. Right-click the folder or file for which you wish to undo pending changes, and choose Undo Pending Changes; the Undo Pending Changes dialog box appears.

  4. In the Files listing, ensure that the folder or file for which you wish to undo pending changes is selected, and click Undo Changes; you are returned to Source Control Explorer with the pending change type removed in the Pending Change column.

    If you undo an edit, your copy of the file is replaced with an unmodified version of the file you checked out (unless you have performed a get operation since pending the edit; in which case the version you tried to get will be downloaded).

    If you undo a delete, the version you deleted is restored (unless you have performed a get operation since pending the delete; in which case the version you last tried to get will be downloaded).

    If you undo an add, the file is left undisturbed.

To undo a pending change from the command line

  1. Click Start, click All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and then click Visual Studio Command Prompt.

  2. Type cd path, where path is the location of the directory used to store your personal copy of the files in the server (for example, c:\projects).

  3. Type **tf undo <folder or filename>**and then press Enter.

    Note

    For the full syntax available for the Checkin command, see Undo Command.

See Also

Reference

Undo Command

Concepts

Submitting Changes to the Source Control Server