A PR was merged into the wrong base branch (`develop` instead of `main`).
IntermediateScenarioRemotes, Collaboration and Pull Requests
Answer
Situation read → The change is live in the wrong place and may already trigger a deploy.
What I'd do →
- If
developis shared:git revert -m 1 <merge-sha>(or revert the squash commit) and push. - Open the correct PR against
mainfrom the original branch. - If the revert then blocks the re-merge, revert the revert when you want it back on
develop. - Check what deployments ran and roll back if needed.
Why → Reverting keeps the shared history intact and avoids force-pushes.
Interview tip → Prevention: restrict who can change PR base, and protect both branches.
More on Remotes, Collaboration and Pull Requests
You are new to a team. How do you collaborate daily without stepping on others' toes?BeginnerYou are migrating a repo from Bitbucket to GitHub and must keep every branch and tag.IntermediateYou want to contribute a fix to an open-source project you do not have write access to.BeginnerA teammate sent a 3,000-line PR and nobody can review it properly.IntermediateA reviewer asks for changes. How do you update the PR cleanly?BeginnerYour team wants stacked PRs so that large work arrives in small reviewable steps. How do you set it up?Advanced