git revert是用一次新的commit来回滚之前的commitgit reset是直接删除指定的commit

 

git log 查询回滚版本唯一commit标识代码

git reset --hard HEAD~3 会将最新的3次提交全部重置,就像没有提交过一样。

 

 

--mixed === git reset

 

会保留源码,只是将git commitindex 信息回退到了某个版本.

 

--soft

 

保留源码,只回退到commit 信息到某个版本.不涉及index的回退,如果还需要提交,直接commit即可.

 

--hard

 

源码也会回退到某个版本,commitindex 都回回退到某个版本.(注意,这种方式是改变本地代码仓库源码)

相关文章:

  • 2021-12-09
  • 2022-01-01
  • 2021-12-07
  • 2022-12-23
  • 2022-03-06
猜你喜欢
  • 2021-06-01
  • 2021-10-08
  • 2021-11-01
  • 2021-05-22
  • 2021-11-14
  • 2021-09-15
相关资源
相似解决方案