A defendant can attempt to withdraw their plea at any time prior to sentencing, but there is no absolute right to do so. The rule that governs this requires the defendant to demonstrate that there is a “fair and just reason” to allow the plea to be withdrawn.
Unfortunately, there is no concrete standard for what constitutes a “fair and just reason,” but it typically requires:
(1) a declaration of innocence (which must include some sort of legal or factual basis),
(2) an explanation of the request’s timing (pleas cannot be withdrawn for merely strategic reasons, so there must be a plausible justification for why the plea is being withdrawn at a particular time), and
(3) a finding that withdrawing the plea would not unreasonably hinder the prosecutor from renewing their pursuit of the case should they choose to do so (though strong enough evidence of innocence can negate this).