"Mengubah" means to change (in general) while "mengganti" means to change something with something (as a replacement).
Example: I change you = "aku mengubahmu", but, I change my car (with a new one) = "aku mengganti mobilku"
You change your clothes with other clothes, so it uses "mengganti" instead of "mengubah".
"-nya" functions both as a (n almost) definite article and 3rd person possesive marker. In this sentence, because there is the pronoun "dia", "-nya" functions as a possesive marker, hence "his/her shirt". Actually, it's relatively rare to use "-nya" as a definite article in writing; it's often used in speech instead.