Created
April 10, 2020 13:17
-
-
Save tpiekarski/0750fee11fe75435bcc4b23551251504 to your computer and use it in GitHub Desktop.
Moving commit to another branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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