to revert a file in git, use checkout command: git checkout filename