Section 306(4) in The Code of Criminal Procedure, 1973
(4)Every person accepting a tender of pardon made under sub-section (1) -(a)shall be examined as a witness in the Court of the Magistrate taking cognizance of the offence and in the subsequent trial, if any;(b)shall, unless he is already on bail, be detained in custody until the termination of the trial.