Dismissal by the district attorney of an indictment or of a count of an indictment, discharges that particular indictment or count. The dismissal is not a bar to a subsequent prosecution, except that:
(1) A dismissal entered without the defendant's consent after the first witness is sworn at the trial on the merits, shall operate as an acquittal and bar a subsequent prosecution for the charge dismissed; and
(2) A dismissal entered after a city court conviction has been appealed to the district court for a trial de novo, shall operate as an acquittal and bar a subsequent prosecution for the charge dismissed.