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

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

  •  
  •   Veneris · Aug 6, 2020 · 2558 views
    This topic created in 2285 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
    joyme
    Aug 6, 2020
    1
    git reflog?
    lilywang
    lilywang
    Aug 6, 2020
    2
    git reflog
    Veneris
    Veneris
    OP
    Aug 6, 2020
    3
    @joyme 感谢,可以沉贴了
    Veneris
    Veneris
    OP
    Aug 6, 2020
    4
    @lilywang 感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1442 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 11:29 · PVG 19:29 · LAX 03:29 · JFK 06:29
    ♥ Do have faith in what you're doing.