If you ever come across a scenario where you want to unshelve a shelve set into a branch other than the one it's saved in, then it's an ideal case to use TFS Power tools.
use tfpt unshelve to achieve unshelving of a shelve set to a different branch
Syntax
/>tfpt unshelve [shelvesetname[;username]] [/nobackup][/migrate /source:serverpath /target:serverpath]
- shelvesetname The name of the shelveset to unshelve
- /nobackup Skip the creation of a backup shelveset
- /migrate Rewrite the server paths of the shelved items (for example to unshelve into another branch)
- /source:serverpath Source location for path rewrite (supply with /migrate)
- /target:serverpath Target location for path rewrite (supply with /migrate)
- /undo Undo pending changes from an unshelved shelveset
- /batchsize:num Set the batch size for server calls (default 500)
Sample
you saved a shelveset into Dev branch with the title 'Test Shelve set'. Now you wish to unshelve it into PROD branch. Use the below command -
/> tfpt unshelve “Test Shelve set” /nobackup /migrate /source:”$/MyTeamProject/DevBranch” /target:”$/MyTeamProject/ProdBranch”