I\'d like to move the last several commits I\'ve committed to master to a new branch and take master back to before those commits were made. Unfortunately, my Git-fu is not
Had just this situation:
Branch one: A B C D E F J L M
\ (Merge)
Branch two: G I K N
I performed:
git branch newbranch
git reset --hard HEAD~8
git checkout newbranch
I expected that commit I would be the HEAD, but commit L is it now...
To be sure to land on the right spot in the history its easier to work with the hash of the commit
git branch newbranch
git reset --hard #########
git checkout newbranch