California Penal Code 1018 PC allows defendants to withdraw their guilty pleas under a variety of circumstances. The law states that if you demonstrate “good cause” and file a Motion to Withdraw a Plea either before you are sentenced, or within 6 months of a probationary sentence, then you must be given the opportunity to withdraw the plea and substitute it with a plea of not guilty (if you pled guilty or no contest without an attorney), or, you may be given an opportunity to do the same if you pled guilty or no contest while you were represented by an attorney.
There are six kinds of Motions to Withdraw a Plea to an indictment or an information, or to a complaint charging a misdemeanor or infraction:
2. Not guilty.
3. Nolo contendere, subject to the approval of the court. The
court shall ascertain whether the defendant completely understands
that a plea of nolo contendere shall be considered the same as a plea
of guilty and that, upon a plea of nolo contendere, the court shall
find the defendant guilty. The legal effect of such a plea, to a
crime punishable as a felony, shall be the same as that of a plea of
guilty for all purposes. In cases other than those punishable as
felonies, the plea and any admissions required by the court during
any inquiry it makes as to the voluntariness of, and factual basis
for, the plea may not be used against the defendant as an admission
in any civil suit based upon or growing out of the act upon which the
criminal prosecution is based.
4. A former judgment of conviction or acquittal of the offense
5. Once in jeopardy.
6. Not guilty by reason of insanity.
A defendant who does not plead guilty may enter one or more of the
other pleas. A defendant who does not plead not guilty by reason of
insanity shall be conclusively presumed to have been sane at the time
of the commission of the offense charged; provided, that the court
may for good cause shown allow a change of plea at any time before
the commencement of the trial. A defendant who pleads not guilty by
reason of insanity, without also pleading not guilty, thereby admits
the commission of the offense charged.