how to remove file changes in git

C#
git checkout -- .
# Discarding local changes (permanently) to a file:
git checkout -- <file>

# Discard all local changes to all files permanently:
git reset --hardgit clean -df
git checkout -- .

Source

Also in C#: