Each rehearing under this chapter shall take place before a court-martial composed of members not members of the court-martial which first heard the case. Upon a rehearing the accused may not be tried for any offense of which he was found not guilty by the first court-martial, and no sentence in excess of or more severe than the original sentence may be imposed, unless the sentence is based upon a finding of guilty of an offense not considered upon the merits in the original proceedings. If the sentence approved after the first court-martial was in accordance with a pretrial agreement and the accused at the rehearing changes his plea with respect to the charges or specifications upon which the pretrial agreement was based, or otherwise does not comply with the pretrial agreement, the sentence as to those charges or specifications may include any punishment not in excess of that lawfully adjudged at the first court-martial.
N.Y. Mil. Law § 130.62