首页 > 编程知识 正文

git怎么返回上一个版本,git的回退命令

时间:2023-05-06 14:41:29 阅读:129587 作者:4464

git返回到上一个版本:1.首先查找版本号: git log

2 .确认恢复到指定版本: git reset --hard f5c706a6、f5c706a6是版本号

3 .强制本地代码与远程仓库同步: git push origin master --force,master主分支

4.error : git : youarenotallowedtoforcepushcodetoaprotectedbranchonthisproject

由于git保护机制,无法强制提交代码。 远程仓库设置要求您取消对代码的保护,更新代码,然后再进行保护。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。