Find and call the right Slack API method.
Recent revisions are kept. Restoring one creates a new revision.