Abandoning Git commits on Github for rejected pull requests

后端 未结 2 812
挽巷
挽巷 2021-02-01 22:12

I\'ve forked someone\'s project and made some commits. I filled out a pull request, and it wasn\'t accepted (either the change was not desirable, or the author rewrote the func

2条回答
  •  难免孤独
    2021-02-01 23:05

    Back your master branch a few steps (assuming you want to skip three commits back) and rewrite your github repo by pushing with -f.

    git reset --hard HEAD~3
    git push -f origin master
    

提交回复
热议问题