Git revert doesn't revert file

257 Views Asked by At

I have a very strange situation with GIT, first time see this. So basically in version control it shows me that i have one changed file. This file is an svg: file_test.svg

When i revert it, it just replaces this file with File_Test.svg. If i try to revert File_Test.svg, it replaces it back with file_test.svg and so on...

So, how that is possible, i didn't touch this svg file + why i can't revert it. Maybe guys you've seen this problem before, how did you resolve it?

1

There are 1 best solutions below

0
Patryk Rudnicki On

To reset local changes for a specific file you can use the command:

git checkout -- pathToFile

When you add this file by mistake you need to use

git reset HEAD pathToFile