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
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.