If judgment of acquittal is given on a general verdict and the defendant is not detained for any other legal cause, he must be discharged as soon as the judgment is given, except where the acquittal is because of a variance between the proof and the indictment, which may be obviated by a new indictment, the court may order his detention to the end that a new indictment may be preferred, in the same manner and with like effect as provided in case where the indictment does not state a public offense.
Idaho Code § 19-2318