When any person transferred pursuant to § 40.1-5.3-7 has sufficiently recovered his or her mental health, he or she may, upon petition of the director and by order of a judge of the district court or justice of the superior court in his or her discretion, be transferred to the place of his or her original confinement, to serve out the remainder of his or her term of sentence.
R.I. Gen. Laws § 40.1-5.3-9