A GraphQL mutation is now available for reverting a merged pull request: revertPullRequest.

Like the revert action on the pull request page in the web, calling this API creates a new pull request that reverses the changes made by the merged pull request.

Learn more about reverting a pull request.