In a local checkout of a git repository I have the following status:
$ git st
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: projects/TouchDetector/5.6.1/_static/doxygen/Doxygen.css
no changes added to commit (use "git add" and/or "git commit -a")
To discard the changes of Doxygen.css
I use the command
$ git checkout -- projects/TouchDetector/5.6.1/_static/doxygen/doxygen.css
However, when checking the status I see again the same status:
$ git st
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: projects/TouchDetector/5.6.1/_static/doxygen/Doxygen.css
no changes added to commit (use "git add" and/or "git commit -a")
So is there another, more reliable, way to discard the changes?
I also tried to do
git reset --hard HEAD
and to remove that file, nothing helps.
I would like to fix this issue without the usual solution, i.e. remove and reclone the repository, as it is 3 GB in size.