Back
If I have n commits, how can I branch from the n-3 commit?
I can see the hash of every commit.
Use the following command to create the branch using hash:
$ git branch branchname <sha1-of-commit>
For example,
$ git branch branchname HEAD~3
In order to checkout the branch while creating it use the following command:
$ git checkout -b branchname <sha1-of-commit or HEAD~3>
31k questions
32.8k answers
501 comments
693 users