Last active
August 21, 2018 03:59
-
-
Save 0x8BADFOOD/11197964 to your computer and use it in GitHub Desktop.
[Git] Remove file from last 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
#roll back commit | |
git reset --soft HEAD^ | |
#remove file from index | |
git reset HEAD path/to/unwanted_file | |
#commit again without unwanted files | |
git commit -m "My commit message" | |
#Source: http://stackoverflow.com/questions/12481639/remove-files-from-git-commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment