git 版本回退记录

1.git log查看版本commit信息。会有一个超级长的串,比如 996997840aba8e91415cb914d77ebb55fece33bc。

2.如果觉得太杂了,可以输入git log  --pretty=oneline 会简化不少信息。

3.git reset --hard id “id”替换为上面的长串id。

4.git push origin HEAD --force 强制推送你本地的回退版本。

这里可能会报错:You are not allowed to force push code to a protected branch on this project

找到项目 Settings 里的 Repository,点击Projected Branches: