1.首先查找版本号:git log 2.确定恢复到指定版本:git reset --hard f5c706a6,f5c706a6为版本号 3.强制将本地代码同步到远程仓库:git push origin master --force,master主分支 4.error: Git:You are not allowed to force push code to a protected branch on this project 由于git 的保护机制,不能强制提交代码,需要在远程仓库的设置中,将代码保护去除,更新完代码,再保护即可。
git回退到上一个版本:1.首先查找版本号:git log2.确定恢复到指定版本:git reset --hard f5c706a6,f5c706a6为版本号3.强制将本地代码同步到远程仓库:git push origin master --force,master主分支4.error: Git:You are not allowed to force push code to a protected branch on this project由于git 的保护机制,不能强制提交代码,需要在远程