Back in 1989, Mike O'Donnell (ZAC EFRON) was the star basketball player at Hayden High School. But when he learned that his girlfriend, Scarlett (ALLISON MILLER), was pregnant, he decided to give up his dreams and marry her instead. Now, 20 years later, Mike (MATTHEW PERRY) isn't happy with any part of his life.
Beyond being passed over for a promotion at work, Scarlett (LESLIE MANN) has filed for a divorce that will be complete in a few weeks, while his teenage kids, Maggie (MICHELLE TRACHTENBERG) and Alex (STERLING KNIGHT), don't want much to do with him either. Accordingly, he's been staying with his friend, Ned Gold (THOMAS LENNON), who might be just as nerdy as he was back in high school, but now is an ultra-rich software developer.
While trying to connect with his kids who attend his old school, Mike has a meeting with an old janitor who somehow causes the unhappy man to be transported through a vortex where he comes out still in the present day, but back in his former 17-year-old body. After getting over that shock, he and Ned come up with the idea that Mike will pose as Mark, Ned's son and a new student at Hayden High.
While Ned tries to hit on Principal Jane Masterson (MELORA HARDIN), Mike tries to help Maggie and Alex who obviously don't recognize them. That's complicated by the fact that school bully Stan (HUNTER PARRISH) routinely torments Alex but is also Maggie's bad-boy boyfriend. By befriending Alex, Matt then meets Scarlett who's shaken by his appearance, but thinks nothing more of that. From that point on, and while trying to help out his kids, Matt tries to reconnect with Scarlett and stop her from going through with the divorce.