V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
Veneris
V2EX  ›  git

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

  •  
  •   Veneris · 2020-08-06 10:25:17 +08:00 · 1491 次点击
    这是一个创建于 1349 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    git branch -f master master~1
    

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

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

    谢谢。

    joyme
        1
    joyme  
       2020-08-06 10:26:56 +08:00
    git reflog?
    lilywang
        2
    lilywang  
       2020-08-06 10:29:20 +08:00
    git reflog
    Veneris
        3
    Veneris  
    OP
       2020-08-06 10:30:03 +08:00
    @joyme 感谢,可以沉贴了
    Veneris
        4
    Veneris  
    OP
       2020-08-06 10:30:15 +08:00
    @lilywang 感谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5534 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 390ms · UTC 06:45 · PVG 14:45 · LAX 23:45 · JFK 02:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.