A plaintiff instituting a suit for the specific performance of a contract in writing may pray in the alternative that, if the contract cannot be specifically enforced, it may be rescinded and delivered up to be cancelled; and the court, if it refuses to enforce the contract specifically, may direct it to be rescinded and delivered up accordingly.