When using git to switch branches, it reminds me that there are changes locally, prepare to reset and then switch branches:
git reset --hard
git status
But did not get the desired result:
It still prompts that a file has been modified, which is very strange. reset --hard
It is originally a recovery that does not retain the file modification.
Googled it: Unstaged changes left after git reset --hard - Stack Overflow
It is said that it is .gitattributes
related to the file, so according to the instructions, first delete and then reset:
Here for the record.