方法一、(回滚到原来的版本)

1、在gitlab上找到要恢复的版本号,如:

bbdca96 

2、在客户端执行如下命令(执行前,先将本地代码切换到对应分支):

git reset --hard bbdca96

3、强制push到对应的远程分支(如提交到develop分支)

git push -f -u origin develop

 

方法二、(生成新版本)

1、找到你误提交之前的版本号

2、git revert -n 版本号

3、git commit -m xxxx 提交

4、git push 推送到远程

相关文章:

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