git revert 和 reset
2018-09-04 本文已影响0人
时彬斌
在开发过程中可能会遇见需要回退到指定的commit的情况,git目前有两种方式可以做到回到历史;
git revert 是在当前的基础上回退到指定的commit,同时会生成一个新的commit 即revert commit; 如下所示
git revert -m 1 2972f79e6b2439133caceb8e3dfe7ca6a848725e
git reset 是在当前的commit上回退到那个提交上,不保留提交历史。

git reset 6e10921