Skip to content

Instantly share code, notes, and snippets.

@htuscher
Created August 31, 2013 09:06
Show Gist options
  • Save htuscher/6397088 to your computer and use it in GitHub Desktop.
Save htuscher/6397088 to your computer and use it in GitHub Desktop.
How to move recent commits 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