Skip to content

Instantly share code, notes, and snippets.

@0x8BADFOOD
Last active August 21, 2018 03:59
Show Gist options
  • Save 0x8BADFOOD/11197964 to your computer and use it in GitHub Desktop.
Save 0x8BADFOOD/11197964 to your computer and use it in GitHub Desktop.
[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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment