git reflog

上节我们介绍了git log命令,可以查看git仓库的所有提交记录,但是git log不能查看已经被删除的 commit 记录和 reset 的操作

这节我们介绍一个记录更详细的命令 git reflog

git reflog是Git操作的一道安全保障,它能够记录几乎所有本地仓库的改变,包括所有分支的commit提交,以及已经被删除的commit。

$ git reflog
f42e369 (HEAD -> master) HEAD@{0}: commit: 新增一行div
08bf08a HEAD@{1}: commit (initial): 初始化index文件

git reflog与git log用法大致相同,在git log上适用的参数在git reflog基本也是适用的。

最后更新于

这有帮助吗?