git revert back changes done in a single file in PR code example Example: git revert one file git checkout HEAD -- /directory/my-file.txt