V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
Veneris
V2EX  ›  git

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

  •  
  •   Veneris · Aug 6, 2020 · 2195 views
    This topic created in 2094 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   ·   Solana   ·   2472 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 08:05 · PVG 16:05 · LAX 01:05 · JFK 04:05
    ♥ Do have faith in what you're doing.