Team Foundation server rollback

Source: Internet
Author: User
Recently, some projects need to be rolled back, and no rollback operation is found on the tfs ui.
After Baidu, a blogger on csdn found a method. After verification, the method is wrong:
He first obtains the specified change set-"check out-" and signs it back to achieve rollback.
It seems reasonable on the surface, but if the change set to be rolled back has a delete operation, it will lead to some errors.
For example, the test. CS file in change set 5 is deleted and checked in (Change set 6 ). Obtain test. CS of change set 5, and then check in (Change set 7 ). In this case, test. CS cannot match test in change set 5. CS, So if you view test. only change set 7 is available in the CS history. Previous versions can only be retrieved from the parent directory.

It also causes some other exceptions. After talking about this, what should we do with the correct method?

You must first download team Foundation server power tools:
: Http://www.microsoft.com/downloads/details.aspx? Familyid = FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0 & displaylang = en
Using the command line in it to roll back and forth, Microsoft places some dangerous operations in the command line, such as the destruction operation and the forced check-in operation. These operations should be performed by administrators familiar With TFS to avoid unnecessary losses.

Rollback uses the tfpt rollack command in power tools. Tfpt needs to run in powershell.

Procedure:
1. Map the workspace to be rolled back to the local device in team explorer.
2. Open powershell in power tools in the Start Menu.
3. Use the CD command to navigate to the directory you mapped to, for example, cd c: \ project1 (if you map the project to the C: \ project1 directory)
4. Enter tfpt rollback. It will prompt you whether to get the latest version. Select Yes.
5. Select the change set to be rolled back (Note: This is the change set you want to undo)
6. After rollback, you must also perform the check-in operation. rollback is committed to the server.

Note:
When performing rollback, you must ensure that no changes are pending for all projects in the current workspace, not only the contents in the directory you want to roll back are not suspended. Otherwise, you will receive the following message:
Cannot proceed because you have pending changes in your workspace. You must move
To a shelveset, undo, or check in all pending changes before reverting a change
Set.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.