Created
October 26, 2023 14:55
-
-
Save victusfate/6662335665490758720e7ff8f9c40937 to your computer and use it in GitHub Desktop.
convert_last_commit_to_different_branch.txt
This file contains hidden or 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
# Stash the changes: This will take your current changes and stash them. | |
git reset HEAD~1 | |
# Copy code | |
git stash | |
#Switch to the desired branch: | |
git checkout [branch-name] | |
# Apply the stash to the branch: | |
git stash apply | |
# Or, if you want to apply the stash and drop it from the list of stashes: | |
git stash pop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment