26.04.2015 Views

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How to Undo a Check-in<br />

To undo the check-in of a file, use the <strong>Team</strong> <strong>Foundation</strong> Power Tools (TFPT) rollback<br />

command to revert the file to the previous version. The rollback command enables you<br />

to roll back an entire changeset at a time, but you can also select individual files from<br />

<strong>with</strong>in the changeset to roll back. This is useful if you need to undo a change to a file that<br />

was mistakenly checked in, or where you want to undo the check-in because the changes<br />

are causing serious integration build issues.<br />

To undo a file check-in and revert to the previous version<br />

1. Run the following command from a command window that includes the \program<br />

files\microsoft team foundation server power tools folder in the path:<br />

TFPT rollback filename.cs<br />

Note: If you know the changeset number of the changeset containing the check-in<br />

you want to undo, you can supply the changeset number on the command line as<br />

follows:<br />

TFPT rollback filename.cs /changeset:54<br />

2. The rollback command needs to ensure that your local workspace is up to date.<br />

Click Yes in response to the Roll Back Changeset message. At this point your<br />

workspace is updated <strong>with</strong> files from the server.<br />

3. If you did not specify a changeset number on the command line, the Find<br />

Changeset dialog box is displayed. Enter search criteria, or simply click Find and<br />

then locate and select the changeset that contains the check-in you want to undo, and<br />

then click Roll Back.<br />

4. The Roll Back Changeset dialog box is displayed .Because the changeset might<br />

contain multiple check-ins, you should select the file for which you want to undo the<br />

check-in and then click Roll Back.<br />

Note: If you specified the filename on the command line, only this file in the<br />

changeset will be selected.<br />

When undoing check-ins by using the TFPT rollback command, you should be aware of<br />

the following:<br />

• Workspace location – TFPT locates workspaces as follows: If you specify a file path<br />

as an argument to filter the rollback, the file paths are used to find the workspace. If<br />

you do not specify file paths, the local directory is used to identify the workspace, if<br />

the local directory is mapped. The simplest approach to ensure that the tool locates<br />

the right workspace is to run the command from a locally mapped directory.<br />

• Pending changes – You cannot roll back a changeset that contains pending changes.<br />

If you attempt to do so, the tool reports an error. In this instance, you must move<br />

pending changes to a shelveset and then undo or check in all pending changes before<br />

running the rollback command.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!