Don't panic. You can even take out the dead battery anytime (but you don't have to), and when you get a new battery your tama will still be in there.
Put in the new battery. Replace the cover and tighten the screw. An egg will appear on the screen. Now press the B button. Your choices will be RESET or DOWNLOAD. Choose DOWNLOAD. Your tama will be back and all your points too.