Also known as redemption. This is when someone who was previously wicked decided to become good.
Although there are plenty of reasons of someone becoming good most fall under four categories: dissatisfaction, betrayal, team-up, and sanity.
This kind of redemption is centered when someone is dissatisfied of how to do his/her own way of things.
Take Zuko for example; he only wishes to capture the Avatar so that he can restore his place as the prince of the Fire Nation. However, after being accepted back, he feels that is not enough for him. But after Iroh convinces him to make the right decision, he made the choice in betraying the Fire Nation and joining the Avatar.
Because of dissatisfaction, Zuko ends up helping the people he once hated, and made himself a new Fire Lord.
The most reason for a someone bad to turn into good. A lot of the bad guys' mooks only tried to find improvement for their boss; only for that boss to payback them with mistreatment.