Reset a file
To reset a file to the original file
To reset a file to its orginal file (remove your changes to the file abc.txt)
1
# With Git 2.23
2
git restore abc.txt
3
​
4
# With older version of git
5
git checkout -- abc.txt
Copied!
To do full reset a file (reset the file back to original remote format)
1
git checkout @ -- abc.txt
2
​
3
git checkout HEAD -- abc.txt
Copied!
Last modified 3mo ago
Copy link