git checkout -- . 可以反悔吗
大家讲道理
大家讲道理 2017-04-24 09:10:50
0
3
630

不慎在错误的目录执行了git checkout -- .,导致最近的更改都被恢复成commit时的状态。
是否有命令可以找回丢失的更改呢?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
洪涛

The content added to the index can be retrieved (but only the file content, no file name information, requires manual identification), the parts that have not been added have been deleted, you can only resort to other methods (backup files, undelete recovery, etc.).

迷茫

As far as I know, you can’t restore without stage changes.

If stage(add) is passed, it may be possible to recover (provided that git gc cannot be run): Use git fsck --lost-found 找到 dangling blob,然后使用 git show <sha_id> to see if this file is one you have restored before.

大家讲道理

git reset --hard HEAD~1 You can recover

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template