When a defendant who has given bail appears for trial, the Court may, in its discretion, at any time after his appearance for trial, order him to be committed to the custody of the proper officer of the county, to abide the judgment or further order of the court, and he must be committed and held in custody accordingly.