Last active
January 14, 2022 09:35
-
-
Save lftbrts/f0afa219a648735ff7795d449d9c4cb7 to your computer and use it in GitHub Desktop.
how to remove files from commit after push
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
# HEAD~x means going back x commits before HEAD | |
git reset --soft HEAD~2 | |
# run next cmd for all unwanted files | |
git reset HEAD path/to/unwanted_file | |
# squash commit | |
git commit -c ORIG_HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment