Deleted branch <your-branch> (was <sha>)\nRun Code Online (Sandbox Code Playgroud)\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0要恢复分支,请使用:
\n\ngit checkout -b <branch> <sha>\nRun Code Online (Sandbox Code Playgroud)\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0使用以下命令在已删除分支的顶端查找提交的“sha”:
\ngit reflog\nRun Code Online (Sandbox Code Playgroud)\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0要恢复分支,请使用:
\ngit checkout -b <branch> <sha>\nRun Code Online (Sandbox Code Playgroud)\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0您可以尝试通过将分支重置为使用以下命令找到的提交的 sha 来恢复分支:
\ngit fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\\ -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt\nRun Code Online (Sandbox Code Playgroud)\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0 然后您可以使用以下之一显示每个提交:
\ngit log -p <commit>\ngit cat-file -p <commit>\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
2513 次 |
| 最近记录: |