Restore a deleted package version
Undo a delete_package_version call, within GitHub’s ~30-day retention
window.
-
Know the exact
org,packageType,packageName, andversionIdof 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 plaingithub_api_errorrather than corrupting anything. -
Call the tool:
restore_package_version { org: "your-org", packageType: "npm", packageName: "your-package", versionId: 123456 } -
On success you get back
{ org, packageType, packageName, versionId }.
No confirm-echo guard
Section titled “No confirm-echo guard”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.
Verify it worked
Section titled “Verify it worked”Call get-package-version with the same org,
packageType, packageName, and versionId to confirm the version is
visible again.