The court may allow a defendant to withdraw a plea of guilty or no contest if it is necessary to correct a manifest injustice. Upon withdrawal of a plea, the charges against the defendant will be reinstated automatically as they existed before the plea agreement.
Ariz. R. Crim. P. 17.5