How to remove commits from a pull request

前端 未结 5 1177
既然无缘
既然无缘 2020-12-22 16:38

I did a pull request but after that I made some commits to the project locally which ended polluting my pull request, I tried to remove it but without any luck.

I fo

5条回答
  •  心在旅途
    2020-12-22 17:31

    You have several techniques to do it.

    This post - read the part about the revert will explain in details what we want to do and how to do it.

    Here is the most simple solution to your problem:

    # Checkout the desired branch
    git checkout 
    
    # Undo the desired commit
    git revert 
    
    # Update the remote with the undo of the code
    git push origin 
    

    The revert command will create a new commit with the undo of the original commit.

提交回复
热议问题