找到你误提交之前的版本号;
git revert -n 版本号 (版本号通过'git log'命令查看,复制你想要回滚的目标版本号);
git revert -n 版本号
git commit -m YOUR_COMMIT_MSG 提交代码到本地仓库;
git commit -m YOUR_COMMIT_MSG
git push -f origin master 提交/推送代码到远程仓库。
git push -f origin master
使用git reset –hard 版本号的方式也可以,两者的区别在于《方式一》会新建一个历史记录而reset不会。
git reset –hard 版本号