首页 > 解决方案 > 无法撤消 Git 中的文件

问题描述

我有一个奇怪的情况,在某些提交之后,文件在 Git 中被修改,我无法撤消它。

我们正在使用 LFS,该文件是二进制文件。LFS 安装在我的机器上,并针对存储库进行了配置。

请注意:

C:\xyz\tip [master ≡ +0 ~1 -0 !]> git st
## master...origin/master
 M Dependencies/BSI/Debug/64/TFC80NET.dll
C:\xyz\tip [master ≡ +0 ~1 -0 !]> git reset --hard HEAD
Encountered 1 file(s) that should have been pointers, but weren't:
        Dependencies/BSI/Debug/64/TFC80NET.dll
HEAD is now at 9ffa900f53 Merged PR 7525: Adding relationship conditions only do not enable Save button
C:\xyz\tip [master ≡ +0 ~1 -0 !]> git co HEAD -- Dependencies/BSI/Debug/64/TFC80NET.dll
Encountered 1 file(s) that should have been pointers, but weren't:
        Dependencies/BSI/Debug/64/TFC80NET.dll
C:\xyz\tip [master ≡ +0 ~1 -0 !]>

到底是怎么回事?如何解决它?

标签: windowsgit

解决方案


对于谷歌员工,正如BheeMa 在这里提供的,这个解决方案对我有用:

git lfs uninstall
git reset --hard
git lfs install
git lfs pull

推荐阅读