commit 丢失情况下的自救措施

误操作丢失了 commit 怎么办?

  • 找到丢失的commit

    1
    git reflog
  • 通过丢失的commit建立新的分支

    1
    git checkout -b recovery commit编号