Phineas and Ferb repair a broken time machine from the museum, and they then travel back in time, accidentally taking Candace with them. The Fireside Girls build a replacement machine to rescue them. Meanwhile, Doofenshmirtz replaces Perry with a new nemesis named Peter the Panda, making Perry depressed.