git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
Veneris
V2EX  ›  git

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

  •  
  •   Veneris · Aug 6, 2020 · 2501 views
    This topic created in 2259 days ago, the information mentioned may be changed or developed.

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

    git branch -f master master~1
    

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

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

    谢谢。

    joyme
        1
    joyme  
       Aug 6, 2020
    git reflog?
    lilywang
        2
    lilywang  
       Aug 6, 2020
    git reflog
    Veneris
        3
    Veneris  
    OP
       Aug 6, 2020
    @joyme 感谢,可以沉贴了
    Veneris
        4
    Veneris  
    OP
       Aug 6, 2020
    @lilywang 感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   975 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:02 · PVG 04:02 · LAX 13:02 · JFK 16:02
    ♥ Do have faith in what you're doing.