将文件恢复到以前的修订后 git diff 显示没有差异?

After reverting a file to a previous revision git diff shows no differences?

在gitreverting a file to a previous revision之后

git checkout abcdefg myfile

git diff myfile <-- 没有显示结果。

还原将更改拉到分段,因此您必须使用

git diff --cached myfile