While changing my code I have made several commits to my Git repo (and pushing each set of changes). As I now need to reinstate an earlier commit to make unrelated changes, I want to save the current code as a branch that I can later return to.
Here is what I want to do. Let's take the commit I want to reinstate as repo_v6. Since then I have made various changes (repo_v6, repo_v7 etc), so that I now have repo_v9:
- repo_v6 <--- I want to go back to this
- make changes, commit as repo_v7
- make changes, commit as repo_v8
- make changes, commit as repo_v9 <--- my current tip
I want to go back to repo_v6, but keep the changes I made between repo_v6 and repo_v9 in a safe place in case I want to use them later.
My repo contains just the master branch, as - not expecting to need branches - I did not create a branch earlier. Though I have read several help topics, I cannot see how to go back - and put aside but keep the changes - without having cretaed a branch earlier. Having never created branches in the past, I do not know what to do. Please can you advise?
I am the only developer who uses the repo, so do not need to consider changes made by others.