I'd like to revert a file to the version of the last commit, but it is still displayed as modified after the checkout.
This is the situation before:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: doc/slides/slides.pdf
...
Then I want to revert it:
$ git checkout doc/slides/slides.pdf
Updated 1 path from the index
Afterwards it is still displayed as modified:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: doc/slides/slides.pdf
...
I even tried to remove it and use Git to check it out again, but it's still displayed as modified. git diff
says:
Binary files a/doc/slides/slides.pdf and b/doc/slides/slides.pdf differ
I'm using pre-commit (with hooks) and DVC. But I doubt this shouldn't make a difference here.