Skip to content

Instantly share code, notes, and snippets.

@TheLandolorien
Created August 29, 2018 18:02
Show Gist options
  • Save TheLandolorien/dad4740efa271cb6b49b12103ed98334 to your computer and use it in GitHub Desktop.
Save TheLandolorien/dad4740efa271cb6b49b12103ed98334 to your computer and use it in GitHub Desktop.
Remove files from previous git commit
#--------------------------------------------------
# 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