In Tortoise HgWorkbench I can right click on a saveset and select Update... which allows me to force my workspace to set its contents to match that saveset. I have to select checkbox to "Discard local changes". I'm now using TortoiseGit and also SourceTree with Git. What is the equivalent command to do an update to a previous node in a branch? Effectively I want to temporarily revert my workspace to a previous revision discarding everything that is currently in it but without losing any of my previous commits and then later return my workspace to my most recent commit.
To revert back to a previous revision and discard subsequent local changes, open the log, right-click on the appropriate revision and choose Reset master to this
.
If you want to revert back to a previous revision without affecting changes already committed, open the log, right-click on the appropriate revision and choose Switch/checkout to this
.
Similarly to TortoiseHg, the active revision is highlighted in bold:
To go back to the latest revision of master again, simply right-click on it and choose Switch/Checkout to "master"
:
The temporary branch that was created can also be deleted by right-clicking on its log entry and choosing Delete refs/head/tmp_branch
.
To open the log, right-click on a folder containing a repository (it will have a hidden subfolder called .git) and choose TortoiseGit -> Show log
. The log is context-sensitive. If you then you will see the full revision history for the current branch. However it's also possible to open up the logs of sub folders or individual files to only see their revision history.