Created
August 29, 2018 18:02
-
-
Save TheLandolorien/dad4740efa271cb6b49b12103ed98334 to your computer and use it in GitHub Desktop.
Remove files from previous git commit
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
#-------------------------------------------------- | |
# How to Split git commits | |
#-------------------------------------------------- | |
# Checkout specific commit | |
git cherry-pick <commit> | |
# Reset to previous commit | |
git reset --soft HEAD^ | |
# Remove unwanted files | |
git reset HEAD <path/to/file.ext> | |
# Commit with original commit message | |
git commit -c ORIG_HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment