How to remove a file from a git commit

07 September 2016

If you need to quickly remove a file from a commit you just made …

git checkout <commit sha> <path to file>

git commit --amend

and rewrite the commit message without the file.



comments powered by Disqus