回退命令:
$ git reset --hard HEAD^ 回退到上個版本 $ git reset --hard HEAD~3 回退到前3次提交之前,以此類推,回退到n次提交之前 $ git reset --hard commit_id 退到/進到 指定commit的sha碼
強推到遠程:
$ git push origin HEAD --force
回滾報錯
參考文檔:
解決 GitLab: You are not allowed to force push code to a protected branch on this project問題
原文出處:it回滾代碼到某個commit

