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

2019-03-13  本文已影响0人  torres2019

场景: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  提交回滚,并且工作区,和暂存区

上一篇 下一篇

猜你喜欢

热点阅读