ConstantinEx
ConstantinEx

Reputation: 190

Git revert doesn't revert file

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?

Upvotes: 4

Views: 270

Answers (1)

Patryk Rudnicki
Patryk Rudnicki

Reputation: 765

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

Upvotes: 0

Related Questions