Mike O'Donnell is ungrateful for how his life turned out. He gets a chance to rewrite his life when he tried to save a janitor near a bridge and jumped after him into a time vortex.
37 year old Mike O'Donnell is extremely disappointed with his life because of some of the choices he made when he was 17. His wife threw him out of the house his kids think that he's a loser and want nothing to do with him, he lost his job. One small action gave him a another shot at his senior year in high school. For his kids he goes from a loser of a dad to an amazing friend that gives them great advice. He also realizes the things that he didn't realize when he was actually 17. Seeing senior year from a different point of view makes him realize that doing your life over isn't as fun as it seems.
In 1989, 17-year-old Mike O'Donnell (Zac Efron) learns from his girlfriend Scarlet (Allison Miller) that she is pregnant during the start of his high school championship basketball game. Moments after the game begins, he abandons the game and goes after Scarlett, abandoning his hopes about a professional basketball league.Mike's coach Murphy (Jim Gaffigan) had told him that he was on the verge for a full college scholarship, if he continued playing the way he was.
In 2009, Mike (Matthew Perry), now a 37-year-old finds his life stalled. Scarlet (Leslie Mann) has separated from him due to his regrets about abandoning college, forcing him to move in with his geeky and wealthy best friend since high school, Ned Gold (Thomas Lennon).Ned is now rich as he made the software that allowed P2P sharing of music, and then made software that stopped it.
Scarlet says that Mike can link every failure in his life to his not going to college and has spent the last 17 years reminding Scarlet about it. Scarlet retorts that she never asked Mike to marry her. The divorce is in 2 weeks. Naomi (Nicole Sullivan) is Scarlet's best friend.
At his job we see another reason for his frustration: he is significantly older than most of his co-workers and he is passed over for a promotion he deserves in favor of a much younger female worker. Mike works at a pharmaceutical company and has the best sales numbers on his team. He has been with the company for 16 years, and yet was passed over in favor of someone who has been in the team for 2 months.He gets fired from his job (after smashing his boss's Bluetooth earpiece against the wall) and his high school-age children, Maggie (Michelle Trachtenberg) and Alex (Sterling Knight). want nothing to do with him.Later, while visiting his high school to reminisce, an encounter with a mysterious janitor (Brian Doyle-Murray) transforms Mike into his 17-year-old self.
Mike returns to Ned's house and looks in the mirror to realize what happened. He convinces Ned that he is indeed Mike. Ned only agrees when he finds a photo of Mike when he was 17 and sees that it matches him perfectly.After eliminating time travel, and gamma ray exposure, Ned speculates that the situation is the basic spirit guide magic, who wants Mike to find his own path.
Given the chance to re-live his youth, Mike enrolls in high school posing as Mark Gold, Ned's son, and plans to go to college with a basketball scholarship. Ned is instantly attracted to principal Jane, who considers Ned to be a nerd.
As he befriends his children, however, Mike comes to believe that his mission is to help them. Mike finds Alex duct taped to a toilet seat in the bathroom. Alex has a crush on Nicole (Josie Loren) the head cheerleader of the team. Mike learns that Alex's bully Stan is also dating Maggie.Maggie says that she plans to move in with Stan after they graduate. Stan is on the management track at Home Depot and she will attend community college.
Mike comforts Maggie when her boyfriend Stan (Hunter Parrish), the captain of the basketball team, dumps her.With his help, Alex overcomes Stan's bullying to obtain a place with Mike on the basketball team and the girlfriend he desires. Mike starts spending time with Alex at Alex's home.Ned continues to woo Jane with various tactics such as "peacocking", buying her expensive gifts, but nothing works.
Through their children Mike spends time with Scarlet, who is attracted to his remarkable resemblance to her husband in high school. Mike has difficulty resisting his desire for her despite the relationship's apparent inappropriateness.At the same time, he must fend off Maggie's amorous advances (completely unaware that he is her father).Meanwhile, Ned courts Jane Masterson (Melora Hardin), the high school principal who shares a mutual interest in The Lord of the Rings.
Mike throws a party to celebrate a basketball game win at Ned's house. He confronts Stan, who has recently dumped Maggie for refusing to have sex with him. Mike gets knocked out and wakes up to Maggie trying to seduce him. Mike tells Maggie that he is in love with someone else, and Maggie leaves, much to Mike's relief.Scarlet arrives at the party, and Mike shows her that Alex has finally managed to get together with his crush. The two have an intimate conversation where Mike, caught up in the moment, tries to kiss Scarlet. Disgusted, she storms off as Mike tries unsuccessfully to explain his true identity.
On the day of the court hearing to finalize the divorce, Mike makes one last attempt to win Scarlet back (as Mark) by reading a supposed letter from Mike. After he exits, Scarlet notices that the "letter" is actually directions to the courtroom; she begins to grow curious and postpones the divorce by a month. Frustrated that he could not salvage his marriage, Mike decides to once again pursue a scholarship and move on with a new life.
During a high school basketball game, Mike reveals himself to Scarlett. As Scarlett once again runs away down the hall, Mike decides to chase her down once more, but not before handing the ball off to his son. Mike is then transformed back into his 37-year-old self and is reunited with Scarlett.
As Mike prepares for his first day as the new basketball coach at his kids' school, Ned-who has successfully started a relationship with Jane-gifts him a whistle. Both are happy with the fresh starts in their lives.