Skip to content

Instantly share code, notes, and snippets.

@tpiekarski
Created April 10, 2020 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpiekarski/0750fee11fe75435bcc4b23551251504 to your computer and use it in GitHub Desktop.
Save tpiekarski/0750fee11fe75435bcc4b23551251504 to your computer and use it in GitHub Desktop.
Moving commit to another branch
# For all of us who forgetting to branch before starting new things ;)
git branch newbranch
git reset --keep HEAD~1
git checkout newbranch
# For a detailed description refer to:
# https://stackoverflow.com/questions/1628563/move-the-most-recent-commits-to-a-new-branch-with-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment