#software #git ## Fixing a GitHub Pull Request that keeps adding commits "[StackOverflow Answer](https://stackoverflow.com/posts/63129948/timeline) In GitHub a Pull Request denotes the request to merge one branch with another. When either branch is updated, the pull-request is updated too and the merge is re-evaluated. Thus, when you push new changes to a branch that has an outstanding pull request linked to it, the pull request will be updated to include the new changes. To reset your pull request to a previous state you can: ``` git switch branch-you-want-to-fix git branch backup-of-later-changes git reset --hard hash-of-desired-changes git push --force ``` This will create a new local branch with your later changes and will remove those changes from the branch on github. The pull-request will be re-evaluated (one of its sides has been updated with your force push), and you can create a new pull request from your `backup-of-later-changes` branch. As long as the new commits aren't pushed to the pr-branch, they won't automatically appear in it, even if these changes are based on top of your original pr-branch."