目的 :撤销最近一次的代码提交

 

Eclipse 中撤消git push提交

 

 

 

第一步:将本地仓库还原到上一个版本,

具体操作:选中项目 右键—》Team-—》show History 

 

Eclipse 中撤消git push提交

 

 

上图红色圈住的是将要还原的版本。

选中红色标记处---》右键---》Rest--->> Hard(HEAD,Index and Working Tree)

 

Eclipse 中撤消git push提交

 

 

现在本地的代码已经回到了上一个版本,git上的没有变化

 

Eclipse 中撤消git push提交

 

 

 

同时项目提示git有代码更新

 

Eclipse 中撤消git push提交

 

 

 

下一步就是要把本地还原版本提交到git

步骤 选中项目右键-》Team -》Push Branch ‘master’…
注:不要选择Push to Upstream

 

Eclipse 中撤消git push提交

 

 

 

Eclipse 中撤消git push提交

 

 

 

 

Eclipse 中撤消git push提交

 

 

线上的提交记录消失

Eclipse 中撤消git push提交

 

相关文章:

  • 2021-09-25
  • 2021-08-11
  • 2021-09-29
  • 2021-12-05
  • 2022-12-23
  • 2021-12-13
  • 2021-05-17
猜你喜欢
  • 2021-07-22
  • 2021-10-02
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
相关资源
相似解决方案