Section 47. An officer, instructor or employee in any institution named in section forty-six shall, for the purpose of retirement thereunder, be credited with all the time which he has served as such in any of said institutions or in the prison camp and hospital, or as an officer or instructor at the industrial or Lyman school for boys, the industrial school for girls, the Suffolk school for boys or any county training school, if he has not been discharged for misconduct from any of said institutions, or, if so discharged, it was afterward found that he was not at fault; and the restoration to duty or reappointment in the institution from which he was discharged shall be sufficient evidence for his exoneration.