Skip to content

Instantly share code, notes, and snippets.

@htuscher
Created August 31, 2013 09:07
Show Gist options
  • Save htuscher/6397089 to your computer and use it in GitHub Desktop.
Save htuscher/6397089 to your computer and use it in GitHub Desktop.
How to move recent commits into an existing branch
git checkout existingbranch
git merge master
git checkout master
git reset --hard HEAD~3 # Go back 3 commits. You *will* lose uncommitted work.
git checkout existingbranch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment