Monday, July 25, 2022

How to remove a wrong commit from the pull request

 $ git checkout pull_request_branch

 $ git rebase -i HEAD~n //n is the number of commits you would like to see during rebase or you could specify the number of commits you have made to the pull request.

3. Replace pick with drop for commits that you want to discard from the PR

Once you are done with the rebase, push forcefully to the remote branch

$git push origin pull_request_branch -f

You are good!


No comments:

Post a Comment