1、查看提交记录

       git log -30【或者至仓库查看提交记录】

       git 回滚至某个版本

 

 

2、回滚至指定版本【注意备份分支,所修改代码会删除】

     git reset --hard  402bd64a【这里是从仓库获取的】

     git 回滚至某个版本

 

3、提交回滚代码

     git push -f origin master

    注意:

         可能会出现如下错误

    git 回滚至某个版本

 

    解决:

          取消保护状态

          git 回滚至某个版本

 

 

4、再次强制提交

        git push -f origin master

        git 回滚至某个版本

 

参考文件:https://blog-static.cnblogs.com/files/study10000/git%E4%BD%BF%E7%94%A8.css

相关文章:

  • 2022-12-23
  • 2022-02-07
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
猜你喜欢
  • 2022-01-07
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2021-06-30
  • 2022-01-07
相关资源
相似解决方案