PR diff vs commit diff: branch-behind-main shows ghost deletions
Reviewing a feature-branch PR from a subagent and seeing the GitHub diff include unrelated files that look like reverts of recently-landed features.
When a branch is created from an older commit on main, and main has since advanced, the diff (PR view, git diff main..branch) shows the branch as MISSING the newer commits — which renders visually as the branch deleting those features, even though the actual commits on the branch never touched those files. To verify whats really there, run git show --stat <branch-head> to see only the files the branch commit(s) actually changed. If that list is in-scope, the PR is fine; the apparent scope creep is just rebase debt. Fix is a routine rebase before merge, or trust gits 3-way merge to apply just the branch deltas. This trap bites hardest when an agent reports the commit changed N files and you check the PR diff and see 2N or 3N files; always cross-check git show --stat against the agents claim, not the PR diff against main.
Before flagging a PR for scope creep, run git show --stat <branch-head> and git log main..branch to confirm the commits actually touch the suspicious files. If they dont, the branch is just behind main and a rebase will clear the ghost changes.