美文网首页
git revert 和 reset

git revert 和 reset

作者: 时彬斌 | 来源:发表于2018-09-04 19:01 被阅读0次

在开发过程中可能会遇见需要回退到指定的commit的情况,git目前有两种方式可以做到回到历史;

git revert 是在当前的基础上回退到指定的commit,同时会生成一个新的commit 即revert commit; 如下所示

git revert -m 1 2972f79e6b2439133caceb8e3dfe7ca6a848725e

git reset 是在当前的commit上回退到那个提交上,不保留提交历史。

image.png
git reset 6e10921

相关文章

网友评论

      本文标题:git revert 和 reset

      本文链接:https://www.haomeiwen.com/subject/fasnwftx.html