Not sure if this has been posted or not did a few searches for Alt+F4 and Battle Pets, but seems to be pretty basic info.
Anyways if youre going around trying to track down rare pets to collect, After countless battles you finally find a rare! but you accidently kill it instead of caging it.
You can simply Alt+F4 if the battle is still going. Log back in the pet will be revived and you have another chance. Seems to work as many times as needed.