使用git log 查看提交历史日志,找到需要回滚的commit_id
git log
退到/进到 指定commit的sha码
( 退回后会保留commit_id的提交内容,在这次之后的内容都会丢掉 )
git reset --hard commit_id
再次push时需要使用 -f 参数
git push -f
版权声明:本文为hl_java原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
git log
( 退回后会保留commit_id的提交内容,在这次之后的内容都会丢掉 )
git reset --hard commit_id
git push -f