LetFoxRun
V2EX  ›  问与答

使用 git rm 误删掉了 github 一项目里面的代码,还有机会找回吗?

  •  
  •   LetFoxRun · Apr 1, 2014 · 4716 views
    This topic created in 4434 days ago, the information mentioned may be changed or developed.
    失误了,我提交后,发现本地代码也没了。。

    还有机会找回吗?

    谢谢。
    4 replies    1970-01-01 08:00:00 +08:00
    TMBest
        1
    TMBest  
       Apr 1, 2014   ❤️ 1
    回滚不就行了?
    LetFoxRun
        2
    LetFoxRun  
    OP
       Apr 1, 2014
    @TMBest 搞定了,感谢已发送。
    9hills
        3
    9hills  
       Apr 1, 2014   ❤️ 1
    可以,如果提交了,用git revert HEAD 可以将head提交撤销

    但是你不想撤销其他的修改,就用 git checkout HEAD~ 到上一个版本,然后把文件拷贝出去,checkout master,再拷贝回来
    LetFoxRun
        4
    LetFoxRun  
    OP
       Apr 1, 2014
    @9hills 刚才慌了,因为代码虽然是自己写的,但是比较有用,我上传了新代码,发现之前文件夹下的其他代码没了,我git checkout 找回来的是之前新上传的代码。。忘记回滚了。谢谢了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   951 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 22:18 · PVG 06:18 · LAX 15:18 · JFK 18:18
    ♥ Do have faith in what you're doing.