Git使用reset命令撤销提交有三种模式

    1. Mixed
      Mixed为reset操作的默认参数,可以将commitId之后提交的代码和当前位于在存取的代码全部重置到工作区
      1. <!--默认为Mixed操作-->
      2. > git reset commitId


    git-撤销push的代码 - 图1

    1. Soft
      保留当前工作区更改,将commitId以后提交的代码重置到暂存区,以便重新提交
      1. > git reset --soft commitId


    git-撤销push的代码 - 图2

    1. Hard
      将工作区和暂存区代码重置为当前reset 指定的commitId的代码, 此时commitId之后的代码都会被删除
      1. > git reset --hard commitId


    git-撤销push的代码 - 图3

    在使用reset撤销代码后,本地代码版本落后与origin版本,需要使用git push —force来进行强制推送