从丢失的提交中恢复

如果你已恢复到过去的提交并丢失了较新的提交,则可以通过运行来恢复丢失的提交

git reflog

然后找到丢失的提交,并通过执行重置回来

git reset HEAD --hard <sha1-of-commit>