(a) General rule.--Under such regulations as may be prescribed by the Governor or department, all rights, privileges and property affected by an executed portion of a court-martial sentence which has been set aside or disapproved, except an executed dismissal or discharge, shall be restored unless a new trial or rehearing is ordered and such executed portion is included in a sentence imposed upon the new trial or rehearing.
(b) Substitution of administrative discharge for invalid discharge.--If a previously executed sentence of dishonorable or bad-conduct discharge is not sustained on a new trial, the Governor shall substitute a form of discharge authorized for administrative issuance unless the accused is to serve out the remainder of his enlistment.