[英]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.