Change your preferences here.
The user is immediately KOed. The next Pokémon switched in heals all HP and status. If the Pokémon switched in is KOed by Spikes or Stealth Rock, the next Pokémon switched in is healed instead. If the foe is slower, it will attack the Pokémon that is switched in.
Lunar Dance is almost identical, but also restores PP.