1

I have done a commit, pushed my code and already raised a PR. Now I wanna cancel the PR, undo my commit, change something on the same branch and raise another PR. How is that possible? Tnx

abbas
  • 175
  • 1
  • 1
  • 9

1 Answers1

3

First, note that if you modify the remote version of your feature branch (either by pushing new commits or by force-pushing a new history), the PR will update itself after a simple refresh, no need to cancel and recreate it. If the concern is about avoiding someone else merging the PR while you're reworking it, maybe just put it on hold (depends on the platform you're using) (Edit after you mentionned Bitbucket : there's a "needs work" flag for that purpose) or comment it to warn about the situation.

Second, to amend your work on your feature branch :

1) undo commits, do new ones, whatever you need to get your branch like you want it (if this is the real question,i.e. "how to undo a commit", it's already extensively covered on this site and everywhere)

2) force-push your feature branch to reflect your recent local rework on Bitbucket

3) refresh the PR

RomainValeri
  • 14,254
  • 2
  • 22
  • 39