git branch -f 移动分支后如何找回原来的 commit

2020-08-06 10:25:17 +08:00
 Veneris

假设现在 C1 <- C2(master*)

git branch -f master master~1

请问,让 master 指向了 C1 后,不知道 C2 的 hash 情况下,如何找回 C2 这个版本?

因为 git log 也看不到 C2 了...

谢谢。

1506 次点击
所在节点    git
4 条回复
joyme
2020-08-06 10:26:56 +08:00
git reflog?
lilywang
2020-08-06 10:29:20 +08:00
git reflog
Veneris
2020-08-06 10:30:03 +08:00
@joyme 感谢,可以沉贴了
Veneris
2020-08-06 10:30:15 +08:00
@lilywang 感谢

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/696060

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX