git revert last pushed commit which deleted files code example Example: how to remove a pushed file from git git checkout HEAD^ -- /path/to/file