git-reset git-revert

reset是指将当前head的内容重置,不会留任何痕迹。

Sets the current head to the specified commit and optionally resets the index and working tree to match. 

 git reset --hard HEAD~3

会将最新的3次提交全部重置,就像没有提交过一样。

根据--soft --mixed --hard,会对working tree和index和HEAD进行重置。

 

 

revert是撤销某次提交,但是这次撤销也会作为一次提交进行保存。

你可能感兴趣的:(reset)