Undo Command
Discards one or more pending changes to files or folders.
Requirements: See Team Foundation Server Permissions.
tf undo [/workspace:workspacename[;workspaceowner]] [/recursive] itemspec [/noprompt] [/login:username,[password]] [/collection:TeamProjectCollectionUrl]
|
Parameter |
Description |
||
|---|---|---|---|
|
/collection : TeamProjectCollectionUrl |
Specifies the URL of the team project collection that contains the items. For example: http://myserver:8080/tfs/DefaultCollection. If you do not use the /workspace option, by default the team project collection is presumed to be the one that contains the workspace that maps the current directory. |
||
|
itemspec |
Specifies the scope of the items. You can specify more than one itemspec argument. For syntax, see Team Foundation Version Control Command Reference. |
||
|
/login |
Specifies the user account to use to run the command. See Team Foundation Version Control Command Reference. |
||
|
/noprompt |
Suppresses the display of windows and dialog boxes and redirects output data to the command prompt. See Team Foundation Version Control Command Reference. |
||
|
/recursive |
Recursively undoes changes to items in the specified directory and any subdirectories. |
||
|
/workspace workspacename[;workspaceowner] |
Specifies the name of the workspace in which you want to undo pending changes. If not specified, the workspace is the one that maps the current directory. You can specify workspaceowner to undo a pending change in a workspace that belongs to a specific user. If not specified, the workspace is presumed to be the current user, or if specified, the /login:username. You must have the UndoOther permission set to Allow to undo changes in another user’s workspace.
|
For each item on which there is a pending edit change, the undo command determines if the file has been modified on disk. If the file has been modified and the /noprompt option has not been specified, the system prompts you to confirm that you want to proceed. Choose the N key to leave the change in place, the Y key to proceed with only the current change, or the A key to proceed with this and any other modified files that are subsequently detected.
The undo command removes any locks on the items.
-
Develop Code and Manage Pending Changes Use Visual Studio to undo pending changes.
-
To view a list of pending changes in the current or in a remote workspace, use the Status Command. -
You can use the /workspace option (and as needed, the /collection option) to undo changes on a remote dev machine. This capability is especially useful in cases when, for example, a file has been checked out and possibly locked on a dev machine that you cannot access. See the above explanation of the /workspace for information about how this works. -
If you need to clean your workspace (for example, because your work is interrupted by a more urgent task) and want to preserve the pending changes instead of undoing them, you can suspend them. See Shelve Command. You can also preserve the position of your open windows, breakpoints, and other important cues. See Suspend Your Work and Manage Your Shelvesets. -
You can also discard changes that have already been checked in. See Undelete Command and Rollback Command (Team Foundation Version Control).
Note