Section 123(7) in The Code of Criminal Procedure, 1973
(7)Unless such person gives security in accordance with the terms of the original order for the unexpired portion of the term for which he was in the first instance committed or ordered to be detained (such portion being deemed to be a period equal to the period between the date of the breach of the conditions of discharge and the date on which, except for such conditional discharge, he would have been entitled to release), [the District Magistrate, in the case of an order passed by an Executive Magistrate under section 117, or the Chief Judicial Magistrate in any other case] [Substituted by Act 45 of 1978, Section 12, for "the Chief Judicial Magistrate", w.e.f. 18.12.1978.], may remand such person to prison to undergo such unexpired portion.