Skip to content

Instantly share code, notes, and snippets.

@brenogcota
Created April 24, 2023 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brenogcota/6fc275bf91283e4648bb26827125e459 to your computer and use it in GitHub Desktop.
Save brenogcota/6fc275bf91283e4648bb26827125e459 to your computer and use it in GitHub Desktop.
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