Section 123(8) in The Code of Criminal Procedure, 1973
(8)A person remanded to prison under sub-section (7) shall, subject to the provisions of section 112, be released at any time on giving security in accordance with the terms of the original order for the unexpired portion aforesaid to the Court of Magistrate by whom such order was made, or to its or his successor.