Question

In Git I have made a bunch of changes to my master branch, and I also have created a tag called 'BeforeDynamicCasts'. I wish to temporarily switch to 'BeforeDynamicCasts', and then revert back to my master branch.. How can I do this?

enter image description here

I can do switch/checkout to the tag, but not sure how to get back to the master branch afterwards. Is this the correct way to do it? Last time I did this I was not able to get back to my original master branch.

Was it helpful?

Solution

  • Explorer -> Switch/Checkout
  • Select branch, master
  • OK

OTHER TIPS

To be able to go back to the old HEAD after testing the older version I do this (because the old master branch doens't show up anymore in the log after going back):

  • Explorer -> Tortoise git ->show log: write down first 8 characters of SHA of last commit (HHEAD)
  • Explorer -> Tortoise git Switch/Checkout: select older version, click OK
  • play around with older version
  • Explorer -> Tortoise git Switch/Checkout: select commit, enter SHA of HEAD, uncheck 'Create new brach", click OK

This may not be elegant at all, but it works for me

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top