I am follwing the example here Branch from local workspace because I have the same scenario.
Shelveset details dialog appear, after clicking unshelve it showing "An item with the same key has already been added."
Any advice please?
As others have indicated in the comments, undoing changes from the main branch (presumably the SOURCE branch for the shelveset you want to unshelve), should fix the issue, allowing you to continue with the merge behavior.
I had a very similar issue to yourself and after trying a lot of things I discovered it was some pending changes we had been excluded and were easy to miss, that caused the issue.
I've written up how to trouble shoot it against the following question:
TFS 2012 Unshelve to different branch -> An item with the same key has already been added
来源:https://stackoverflow.com/questions/17824465/tfpt-unshelve-migrate-showing-an-item-with-the-same-key-has-already-been-added