2

I sent in a PR to a remote repo and discovered I had the commit from a previous PR included is it possible to delete this unwanted commit?

lauragift21
  • 117
  • 12

4 Answers4

1

You can make a revert commit for unwanted commits. In this answer should be enough info.

Mike Kor
  • 876
  • 5
  • 14
1

Under your repository name, click Pull requests. In the "Pull Requests" list, click the pull request you'd like to close. At the bottom of the pull request, below the comment box, click Close pull request.

Then to revert the last commit or revert to the SHA of the commit ,you can use the command git revert HEAD~1 or git revert (get the commit id from git log)

Charu Jain
  • 36
  • 6
0

You may close a pull request from the GitHub website:

You may choose to close a pull request without merging it into the upstream branch. This can be handy if the changes proposed in the branch are no longer needed, or if another solution has been proposed in another branch.

  1. Under your repository name, click Pull requests.
  2. In the "Pull Requests" list, click the pull request you'd like to close.
  3. The close Pull Request buttonAt the bottom of the pull request, below the comment box, click Close pull request.
  4. Optionally, delete the branch. This keeps the list of branches in your repository tidy.
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
0

You can rebase your branch and update your pull request. Take a look to this link and it'll help to how to remove the commit

Masoud
  • 1,008
  • 1
  • 9
  • 22