本地四个commit:A<B<C<D 远程commit:A<B<C 本地直接回退到B,忘记备份D; git reflog;查看提交记录会有D,记住版本号。 git reset --hard xxx; 好了应该忘不掉了~