Discussion Getting Rollbacked Changes Back Into Solution

  • 3 august 2012 14:40
     
     

    I thought I would share a workaround I found today:

    case: your code was roll-backed and you don't have a shelve-set of it

    question: how do you get your changes back into solution to continue working on them?

    changeset 12351 - rollback of 12349
    changeset 12350 - some changeset
    changeset 12349 - your code
    changeset 12348 - some changeset
    changeset 12347 - some changeset
    changeset 12346 - some changeset
    changeset 12345 - some changeset

    ----------------------------------------------------

    There is a workaround I have found that made it possible.

    You want the changes of 12349 back into the code.

    1. do a rollback of 12351 (yes, a rollback of a rollback)
    2. now you get your changes as a rollback in the pending changes but they have the rollback status/action (and we want the edit/add only status). so for that:
    3. shelve the changes
    4. create a temp branch from your current branch
    5. unshelve the changes you created in step 3 into the temp branch (you can do an unshelve from a different branch by using VS Command Prompt with 'tfpt unshelve' command (e.g. tfpt unshelve "ShelvsetName";UserName /migrate /source:"$/SourceBranch" /target:"$/TargetBranch")
    6. this changes will appear as add/edit for the new branch
    7. now, shelve the changes from the temp branch and unshelve them back into the original branch
    8. you should see your roll-backed changes now with the normal edit/add statuses.

    9. delete the temp branch

    so, the purpose of shelving and unshelving via a temp branch is to get rid of the "rollback" status

    if there are there any other easier ways of merging from an earlier changeset into the latest or shelving a changeset, I would really like to see that.

    thanks


    tridy (Stockholm, Sweden)

Toate mesajele

  • 6 august 2012 01:45
    Moderator
     
     

    Hi Tridy.net, 

    Thanks for your post. 

    And thank you for sharing your experience here. It will be very beneficial for other community members having the similar questions.

    All your participation and support are very important to build such harmonious/ pleasant / learning environment for MSDN community. 


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us