Nothing. Your question presupposes that a phase change occurs, presumably caused by heat energy. After that, the heat doesn't do anything other than persist in being energy. If you are asking how...
Chemical Change - Chemical changes are irreversible (changing it back is often extremely difficult). Physical Change - Physical changes are- reversible (the change back is often quite easy).