Resetting to an Old Revision
In this episode, we're going to restore our complete project to an older version.
Transcript
In this episode, we’re going to restore our complete project to an older version. Put another way, this means we’re setting our HEAD pointer to a previous commit - and effectively, any commits that came afterwards will disappear from our commit history.
Let’s look at a practical example… and say that we want to return to this commit here. In Tower’s history view, we can simply right-click that commit and select “Reset HEAD” from the menu. If you leave the “keep changes” option checked, then Tower will preserve all of the changes in the rolled back commits.
I’ll show you what I mean: if we were to reset to this commit here, the “keep changes” option would preserve the changes from this and this commit as local changes. You can then decide for yourself which changes you actually want to keep or further modify.
The other alternative is to disable the “keep changes” option. And this is very simple: you are left with a clean working copy and no local changes whatsoever.
That’s already it - we have now successfully reset our project to an old version.
Course outlineEpisode 7 of 17
- Discarding All Local Changes in a File
- Restoring a Deleted File
- Discarding Chunks / Lines in a File
- Discarding All Local Changes
- Fixing the Last Commit
- Reverting a Commit in the Middle
- Resetting to an Old Revision
- Resetting a File to an Old Revision
- Recovering Deleted Commits
- Recovering a Deleted Branch
- Moving a Commit to a New Branch
- Moving a Commit to a Different Branch
- Editing Old Commit Messages
- Deleting Old Commits
- Squashing Multiple Commits into One
- Adding a Change to an Old Commit
- Splitting / Editing an Old Commit