No person who has been discharged upon a habeas corpus shall be again imprisoned or restrained for the same cause, unless indicted therefor, convicted thereof or committed for want of bail by some court of record having jurisdiction of the cause; or unless after a discharge for a defect of proof or for some material defect in the commitment in a criminal case, he is again arrested on sufficient proof and committed by legal process.
NMS § 44-1-28