在操作git的时候,发现了一个新的命令git revert,之前一直使用git reset进行版本回退,但git revert好像也实现了内容回退。那git revert是什么,它与git reset有什么区别?

1、git revert用一次新的commit来回滚之前的提交,git reset是直接删除之前的提交

2、git revert将HEAD向前移动一下,git reset将HEAD向后移动一下

3、git revert是一种反做操作,比如你commit一个文件,如果用上的话相当于撤回这个文件,它可以跨过多个版本进行操作

详细见:https://www.jianshu.com/p/2a2d5fe49be4 

    https://www.jianshu.com/p/0720609fc355

相关文章:

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