Sec. 5. If:
(1) prosecution is initiated against a petitioner who has successfully sought relief under any proceeding for postconviction remedy and a conviction is subsequently obtained; or
(2) a sentence has been set aside under a postconviction remedy and the successful petitioner is to be resentenced;
the sentencing court may impose a more severe penalty than that originally imposed. However, the petitioner shall receive credit time accrued or earned while serving the previous sentence.