WARNING: This method works because you are creating a new branch with
the first command: git branch newbranch
.
If you want to move commits to an existing branch you need
to merge your changes into the existing branch before executing git reset --hard HEAD~3
git branch newbranch
git reset --hard HEAD~3
git checkout newbranch