Recover previous version

1. git log check commit log

--oneline: 只显示id以及message

--graph: 分支结构显示

--decorate: 显示HEAD位置

-5: 显示最近5条

2. git reset --hard xxx return to version xxx

HEAD 最近的第一次commit

HEAD^ 最近的第二次

3. git reflog check history command

使用的场景:当使用reset回退了版本,但是又想回到最新(或者相对新)的版本,但是此时的log已经没有id信息了,就可以用该命令找到id信息。

results matching ""

    No results matching ""