How to delete pushed commits and revert to old commit?

This question already has an answer here:

  • Delete commits from a branch in Git 23 answers

  • I wouldn't recommend deleting commits that are already pushed to a remote. This can lead to much confusion for other contributors. Therefore I'd recommend you to revert the commits locally and then push your results: git-revert Documentation.

    If you need to truly delete the commits you should first do git reset --hard COMMIT has you have already done. To delete the commits on the remote you need to rewrite it's history aswell using git push --force . You can find further documentation here.

    链接地址: http://www.djcxy.com/p/9016.html

    上一篇: 如何将一个python字典浸入到MySQL中?

    下一篇: 如何删除推送提交并恢复到旧提交?