更新时间:2023-12-03 13:03:22
Have you looked at the reflog
? It keeps track of every way that HEAD moves inside your repository (and it’s doing its job by preventing the automatic deletion of your commits).
Examine it with git reflog
or git log -g
. Nuke it with git reflog expire --expire=now --all
, and then you can garbage collect the unused commits.