有的时候不小心commit了一些不要的代码,想要撤销本地commit

本教程使用idea工具进行撤销

第一步 选中项目右键git–>show history
IDEA Git操作之本地commit,未push到远程
第二步、选择需要撤回的文件 右键Select in git log
IDEA Git操作之本地commit,未push到远程
第三步、选择需要撤回的文件右键 Undo Commit……
IDEA Git操作之本地commit,未push到远程
第四步、选择需要回退到哪个Local Changes目录下(默认是Default Changelist)点击ok
IDEA Git操作之本地commit,未push到远程
第五步、显示Reset successful表示已经成功撤销本地的commit
IDEA Git操作之本地commit,未push到远程
第六步、现在查看Default Changelist刚才commit的文件已经回退到本地
IDEA Git操作之本地commit,未push到远程
仍在不断学习中,如有不妥还望各位大神留言指教

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2021-10-19
  • 2022-12-23
  • 2021-09-05
  • 2021-05-28
  • 2022-02-07
  • 2021-08-03
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2021-11-01
  • 2021-11-04
  • 2021-09-20
  • 2022-12-23
相关资源
相似解决方案