'TortoiseGit: How do I temporarily switch to an earlier version

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.



Solution 1:[1]

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

Solution 2:[2]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 chrmue