Skip to content

Instantly share code, notes, and snippets.

@0x8BADFOOD
0x8BADFOOD / remove_file_from_last_commit
Last active August 21, 2018 03:59
[Git] Remove file from last commit
#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