git 删除远程仓库的某次提交

删除上一次远程仓库的提交,修改上次提交的代码,做一次更完美的commit。

  • git reset commitId (注:不要带–hard)到上个版本

  • git stash 暂存修改

  • git push --force 强制push,远程的最新的一次commit被删除

  • git stash pop 释放暂存的修改,开始修改代码

  • git add . -> git commit -m "massage" -> git push

参考自:git 怎样删除远程仓库的某次错误提交?

猜你喜欢

转载自blog.csdn.net/Milk_o3o/article/details/79450631