Usually, to discard changes to a file you would do:
git checkout --
What if the change I want to discard is deleting the file?
If it has been staged and committed, then the following will reset the file:
git reset COMMIT_HASH file_path git checkout COMMIT_HASH file_path git add file_path
This will work for a deletion that occurred several commits previous.