美文网首页
9.Git实战系列 场景:git reset --soft 与-

9.Git实战系列 场景:git reset --soft 与-

作者: torres2019 | 来源:发表于2019-03-13 16:29 被阅读0次

场景:git reset --hard 与 git reset --soft 的区别

git reset --hard HEAD^

Resets the index and working tree. Any changes to tracked files in the working tree since are discarded.

git reset --soft HEAD^

Does not touch the index file or the working tree at all (but resets the head to , just like all modes do). This leaves all your changed files "Changes to be

               committed", asgit status would put it.

区别:

--soft   提交回滚 ,不会修改工作区和暂存区

--hard  提交回滚,并且工作区,和暂存区

相关文章

网友评论

      本文标题:9.Git实战系列 场景:git reset --soft 与-

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