Sohail Faruqui
Sohail Faruqui

Reputation: 452

reverting commits from pending pull request

I have a pending PR which adds a specific feature and by mistake, I pushed some other features in that branch and pushed which make both features to be merged in my pending pull request this pull request is old and I had a lot of code merged after that PR which I don't want to be removed, I just need the code which I pushed by mistake to be removed from my pull request I tried to search stack overflow but there are a lot of different ways which I am not able to understand which one is safe for me

Upvotes: 0

Views: 27

Answers (1)

Arun Mathew Kurian
Arun Mathew Kurian

Reputation: 536

Use

git revert commit-hash

This will create a new commit reverting the changes of the specified commit. This can be pushed into the pull request branch.

The commit hash of the commit can be obtained by

git log

in the specified branch

Upvotes: 1

Related Questions