Undo TFS Unshelve

2019-03-01 11:44发布

问题:

I am using Visual Studio 2015. Version of TFS is 2012 (Version 11.0.51106.1). Is there a way to undo unshelve, other's user shelveset, to have situation as before unshelve command?

回答1:

No, there is no this command.Unshelving is how you restore the shelveset to your machine so you can keep working on it. It doesn't change the shelveset or anything else on the server. It's just a get operation.

Seems you just want to bring the code back to how it was before you loaded up someone's shelveset onto the workspace.

If you hadn't made changes in pending changes before loading the shelveset, Undo Pending Changes can solve your problem. Otherwise, you may have to manually excluded the changes you made then undo the changes in shelveset.


Moreover, if you encounter such a situation again, a good suggestion might be to save your workspace to your own shelveset before unshelving anyone else's code.



回答2:

When there is no pending changes ... choose Get Specific Version > Latest Version ... this will restore the files to the last check-in.