[英]Git: reset to a too old commit, and git log , only show from the commit I have now
您可以使用Git的reflog功能,这是对使用Git时发生的所有事情的审计跟踪,包括提交。
git reflog --date=iso
尝试查找类似以下内容的条目:
b28ae3b HEAD@{2016-11-25 15:54:53 +0800}: commit: message for the commit which you
made earlier today
如果您可以找到提交,请记录SHA-1哈希(在此示例中为b23ae3b
),因为您将需要它来恢复该提交的分支。 现在通过以下方法恢复您的分支:
git checkout yourBranch
git reset --hard b28ae3b
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.