Skip to content

Instantly share code, notes, and snippets.

@bom-d-van
Created May 26, 2012 16:40
Show Gist options
  • Save bom-d-van/2794551 to your computer and use it in GitHub Desktop.
Save bom-d-van/2794551 to your computer and use it in GitHub Desktop.
Move recent commit to a new branch
# http://stackoverflow.com/questions/1628563/git-move-recent-commit-to-a-new-branch
git branch newbranch
git reset --hard HEAD~3 # Go back 3 commits. You *will* lose uncommitted work.
git checkout newbranch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment