how to reset a file to head git code example Example: git file reset to head git checkout HEAD -- my-file.txt