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