Skip to content

Instantly share code, notes, and snippets.

Created April 24, 2023 16:35
What would you like to do?
Discard file changes from git PR

Switch to the branch from which you created the pull request:

$ git checkout pull-request-branch

Overwrite the modified file(s) with the file in another branch, let's consider it's master:

git checkout origin/master -- src/package-lock.json

Commit and push it to the remote:

git commit -m "Removed a modified file from pull request"
git push origin pull-request-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment