Skip to content

Support deleting edit-history revisions for issue and PR descriptions #14387

Open

Description

@camjac251

Describe the feature or problem you’d like to solve

GitHub’s web UI lets authors remove a previous revision’s content through edited → Options → Delete revision from history.

gh issue edit and gh pr edit update the current description, but there is no equivalent command to remove a superseded revision’s content. Completing that workflow requires switching to the browser.

This capability would also be useful for comments, particularly when an earlier version contains sensitive information.

Proposed solution

Support listing edit-history revisions and deleting a selected revision’s content using normal GitHub CLI authentication.

Deletion should require confirmation identifying the issue, PR, or comment and the selected revision. It should preserve the editor and timestamp metadata, matching the website’s behavior.

This would let users complete the workflow from the CLI without handling browser-session credentials.

Additional context

GitHub documents the existing browser operation in Tracking changes in a comment.

The public GraphQL API exposes UserContentEdit, including id, diff, deletedAt, and deletedBy. However, a public API request using deleteUserContentEdit was rejected with:

DeleteUserContentEditInput isn't a defined input type
Field 'deleteUserContentEdit' doesn't exist on type 'Mutation'

A successful deletion through the website used a request containing:

{
  "persistedQueryName": "deleteUserContentEditMutation",
  "variables": {
    "input": {
      "id": "<revision ID>"
    }
  }
}

This appears to be an internal website operation rather than a mutation available through gh api graphql. The requested CLI functionality should use a supported API rather than depend on the website’s private endpoint.

If a public API addition is required first, please identify or link the prerequisite tracking request.

Activity

  1. added
    needs-triage
    on Sep 8, 2026
  2. cli-triage commented on Sep 8, 2026

    @cli-triage

    Thanks for the detailed write-up! I'm suggesting the enhancement label — this is a clear feature request (deleting a specific edit-history revision from an issue/PR description or comment, mirroring the web UI's "Delete revision from history" option) with good context, including your investigation into the GraphQL API showing deleteUserContentEdit isn't currently a public mutation. No duplicate issues were found in this repo. Since the underlying mutation doesn't appear to be publicly available yet, a maintainer will likely need to confirm whether a supporting GitHub API exists or would need to be requested first before this can be implemented in gh.

    Generated by Issue Triage (skills-driven) for #14387 · copilot · auto · 20.2 AIC · ⌖ 1.72 AIC · ⊞ 11.2K · ◷

  3. added
    enhancement
    platform
    and removed
    needs-triage
    on Sep 10, 2026
  4. github-actions commented on Sep 10, 2026

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Contributions welcome label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedenhancementplatformstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions