If I have N
commits, how do I branch from the N-3
commit?
Question
Answer
Create the branch using a commit hash:
git branch branch_name <commit-hash>
Or by using a symbolic reference:
git branch branch_name HEAD~3
To checkout the branch while creating it, use:
git checkout -b branch_name <commit-hash or HEAD~3>