1.查找commitId
$ git log
或者在gitlab的history里查找
2.找到需要回滚的commit,输入git reset --hard {commitId},将本地文件回滚:
$ git reset --hard commitId
HEAD is now at d580ea7da add a constellation test case
3.此时本地文件已经回滚到刚刚commit commitId之后的状态,但是服务器仍然没有改变,需要继续远程回滚:
$ git push -f
执行完后回滚成功