gitlab 远程仓库回退到指定版本

参考的这个博客https://blog.csdn.net/qq_37143673/article/details/85258947

step1:查看提交记录,获得版本号

git log
commit 36cc122f5a2218d2b2d4109593a4ec5de589f807
Author: yhl <xxx.com>
Date:   Thu Sep 23 09:51:54 2021 +0800

    ignore

commit 203738c9ccad7d95b728c8d9d287f2ff24eaaca2
Author: chen1234520 <xxx.com.cn>
Date:   Wed Sep 22 18:14:18 2021 +0800

    更新头文件路径

commit a9b26683996b88c2bb87cff9cc1bdae38b9c5708
Author: chen1234520 <xxx.com.cn>
Date:   Wed Sep 22 17:30:07 2021 +0800

    上传测试样例图

commit后面的一串数字就是版本号

step2:本地回退到相应的版本

git reset --hard <版本号>

git reset --hard 203738c9ccad7d95b728c8d9d287f2ff24eaaca2

step3:远程仓库也退到相应的版本

git push origin <分支名> --force

git push origin master --force

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值