Skip to main content
RapidDev - Software Development Agency
github-for-non-tech

How to Cancel a Pull Request in GitHub

To cancel a pull request on GitHub, open the pull request page, scroll to the very bottom, and click the 'Close pull request' button. The pull request moves to the 'Closed' tab but is not deleted — you can reopen it any time. Optionally, delete the associated branch to keep your repository tidy. Closing a pull request does not affect the main branch or your live app.

What you'll learn

  • How to close (cancel) a pull request using the GitHub web interface
  • The difference between closing and deleting a pull request
  • How to reopen a closed pull request if you change your mind
  • When and how to delete the branch after closing
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read3 minutesGitHub.com (any browser)March 2026RapidDev Engineering Team
TL;DR

To cancel a pull request on GitHub, open the pull request page, scroll to the very bottom, and click the 'Close pull request' button. The pull request moves to the 'Closed' tab but is not deleted — you can reopen it any time. Optionally, delete the associated branch to keep your repository tidy. Closing a pull request does not affect the main branch or your live app.

What Happens When You Cancel a Pull Request

A pull request is a proposal to merge changes from one branch into another. Sometimes you open a pull request and then realize the changes are wrong, incomplete, or no longer needed. In that case, you want to cancel it.

On GitHub, there is no 'Cancel' or 'Delete' button for pull requests — instead, you 'Close' them. Closing a pull request means the proposed changes will not be merged. The pull request itself is not deleted; it moves to the 'Closed' tab where you (or anyone) can still view it or reopen it later.

Closing a pull request is completely safe. It does not change your main branch, does not affect your live app, and does not delete any code. The branch that contained the changes still exists unless you explicitly delete it afterward.

This applies to pull requests from any source — whether you created them manually, or an AI tool like Lovable or V0 created them automatically when syncing changes.

Prerequisites

  • A GitHub account with access to the repository
  • An open pull request you want to cancel

Step-by-step guide

1

Open the pull request you want to cancel

Go to your repository on GitHub.com. Click the 'Pull requests' tab in the top navigation bar (between 'Issues' and 'Actions'). You will see a list of open pull requests. Click the title of the one you want to cancel. If you do not see it in the list, make sure the filter at the top says 'Open' (it does by default).

Expected result: You are on the pull request detail page, showing the title, description, commits, and conversation.

2

Scroll to the bottom and click 'Close pull request'

Scroll all the way down to the bottom of the pull request page, past the conversation and commit list. You will see a text box for leaving a comment and, to its right, a button labeled 'Close pull request'. If you want to explain why you are closing it, type a comment first (e.g., 'Closing — these changes are no longer needed'). Then click the 'Close pull request' button. The button may also appear as 'Close with comment' if you typed a message.

Expected result: The pull request status changes from 'Open' (green) to 'Closed' (red/purple). A message at the bottom confirms it was closed.

3

Optionally delete the associated branch

After closing the pull request, GitHub shows a message at the bottom saying 'You're all set — the branch-name branch can be safely deleted.' with a 'Delete branch' button. Click it to remove the branch. This is optional but recommended to keep your branch list clean. If you might want to reopen the pull request later, keep the branch for now.

Expected result: The branch is deleted (if you chose to delete it), and the pull request page shows 'deleted the branch-name branch'.

4

Verify the pull request is closed

Go back to the 'Pull requests' tab. The closed pull request no longer appears in the default 'Open' list. Click the 'Closed' link next to the search bar to see all closed pull requests. Your pull request should be at the top of this list with a red or purple 'Closed' label.

Expected result: The pull request appears in the 'Closed' tab and is no longer in the 'Open' list.

5

Reopen the pull request if you change your mind

If you decide you want to proceed with the changes after all, open the closed pull request from the 'Closed' tab. Scroll to the bottom. If the branch still exists, you will see a 'Reopen pull request' button. Click it, and the pull request moves back to the 'Open' list, ready to be reviewed and merged. If you deleted the branch, you will need to recreate it first.

Expected result: The pull request status changes back to 'Open' (green) and appears in the open pull requests list again.

Complete working example

pull-request-lifecycle.md
1# Pull Request Lifecycle
2
3## States
4
5| State | Color | Meaning |
6|--------|--------|--------------------------------|
7| Open | Green | Waiting to be reviewed/merged |
8| Closed | Purple | Cancelled, not merged |
9| Merged | Purple | Changes added to main branch |
10
11## Actions
12
13- **Close**: Cancel the PR. No code changes. Can reopen.
14- **Merge**: Apply changes to main. Cannot undo merge easily.
15- **Reopen**: Move closed PR back to Open state.
16- **Delete branch**: Clean up after closing or merging.
17
18## Tips
19
20- Close if changes are wrong or no longer needed
21- Leave a comment explaining why you closed it
22- Delete the branch after closing to keep repo clean
23- You can always reopen if the branch still exists

Common mistakes when canceling a Pull Request in GitHub

Why it's a problem: Thinking 'Close pull request' will delete your code

How to avoid: Closing only cancels the merge proposal. Your branch and its commits still exist. Nothing is deleted unless you explicitly click 'Delete branch'.

Why it's a problem: Deleting the branch and then wanting to reopen the pull request

How to avoid: If you might reopen the pull request later, do not delete the branch. You can always delete it later.

Why it's a problem: Confusing 'Close' with 'Merge'

How to avoid: Close = cancel (no code changes to main). Merge = apply changes to main. They are opposite actions. The Merge button is green; the Close button is below it.

Why it's a problem: Not leaving a comment explaining why the pull request was closed

How to avoid: Always write a brief reason before closing so collaborators understand why the changes were abandoned.

Best practices

  • Leave a comment explaining why you are closing the pull request before clicking the button
  • Use 'Close as not planned' to signal intentional abandonment
  • Delete the branch after closing if you are sure you will not reopen it
  • Check if the pull request was created by an AI tool (Lovable, V0) — the tool may recreate it on next sync
  • Review the 'Closed' tab periodically to clean up old pull requests
  • Never close a pull request someone else opened without communicating first

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I have an open pull request on GitHub that I do not want to merge anymore. Walk me through how to close it using the GitHub website, and explain whether closing it deletes any code.

Frequently asked questions

Does closing a pull request delete my code?

No. Closing a pull request only cancels the merge proposal. Your branch and all its commits remain untouched. You would need to separately click 'Delete branch' to remove the branch.

Can I reopen a pull request after closing it?

Yes, as long as the branch still exists. Open the closed pull request and click 'Reopen pull request' at the bottom.

What happens to the branch when I close a pull request?

Nothing automatic. The branch stays exactly as it is. GitHub offers a 'Delete branch' button after closing, but you have to click it manually.

Will closing a pull request affect my live app?

No. Closing cancels the merge, which means no changes reach the main branch. Your live app is completely unaffected.

What if Lovable or V0 created the pull request?

You can close AI-generated pull requests the same way. The AI tool may create a new pull request on the next sync cycle, so you may also need to adjust the changes in the AI tool to prevent it from resending the same update.

Can RapidDev help me manage pull requests across multiple repositories?

Yes. RapidDev can set up pull request workflows, templates, and automated rules across all your repositories so your team stays organized and only the right changes get merged.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.