the DA's office has to decide whether to seek a retrial. There is a time limit, I believe, for that decision to be made.
If they choose not to, he walks.
Another option might be for his attorney to strike some type of deal to avoid retrial.
All a matter of how strong a case the DA has
More information about formatting options