git revert the changes in a file code example Example: git reset one file git checkout HEAD -- my-file.txt