Skip to content

Restore a deleted package version

Undo a delete_package_version call, within GitHub’s ~30-day retention window.

  1. Know the exact org, packageType, packageName, and versionId of the deleted version. If you’re not certain a delete happened recently enough to be recoverable, try the call anyway — a request outside the window, or where something has since republished under the same version, surfaces as a plain github_api_error rather than corrupting anything.

  2. Call the tool:

    restore_package_version { org: "your-org", packageType: "npm", packageName: "your-package", versionId: 123456 }
  3. On success you get back { org, packageType, packageName, versionId }.

Unlike the delete tools, restore_package_version takes no confirm* field. Restoring undoes a delete rather than causing new loss, so it isn’t given the same friction.

Call get-package-version with the same org, packageType, packageName, and versionId to confirm the version is visible again.