通过git log 我们可以查看到各版本的提交历史,因此我们如果想回退到之前某个版本,只需要设置该版本的提交ID即可。

git reset --hard commitID

13.回滚到指定版本git reset --hard <commitID>
git reset --hard commitID

由于我们回退到了之前的版本,之后的版本就会被隐藏,再想通过git log 去查询就找不到对应的提交ID,此时需要使用新的命令 reflog 才能显示之后的版本ID。知道了版本ID才可以进行跳转回滚。

13.回滚到指定版本git reset --hard <commitID>
git reflog

相关文章:

  • 2022-02-07
  • 2021-06-24
  • 2021-05-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2021-06-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-04-23
  • 2021-11-19
相关资源
相似解决方案