Answer the question
In order to leave comments, you need to log in
How do I make the current (master) local branch a spare branch, go back a few commits (to commit-23) and start a new master from there?
1. Git is local.
2. I write commits in master.
3. Now I realized that I want to roll back (say, to commit-23) and start over from it.
4. But I also want to keep the current development in reserve.
How can I do this?
Thank you.
Answer the question
In order to leave comments, you need to log in
git branch -m
rename branch master git checkout -b master <с какого коммита>
checkout from desired commit to new branch
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question