There’s a quick, significant shot in X-Men: Days of Future Past in which the original Star Trek series is clearly referenced. It’s a telling moment, not just for the audible acknowledgment it gets from the audience, but for director Bryan Singer‘s obvious admission that his latest movie is borrowing a major move from the Trek playbook: The time-travel reset, most prominently used in Star Trek: First Contact. Singer, who directed the first two X-Men films but handed control over to Brett Ratner in 2006 for the disastrous X-Men 3: The Last Stand, has regained the reigns with gusto and righted his billion-dollar racehorse.

Not so much a reboot as a reset, X-Men: Days of Future Past (FOUR STARS) cleverly combines the cast of the original X-Men films (Patrick Stewart, Ian McKellen) with younger incarnates from 2011’s First Class (James McAvoy, Michael Fassbender) and restores the smart, sheer fun of the series while maintaining its poignancy and gravitas. In order to save society from a lethal evolution of technology fashioned in the ’70s from mutant DNA, fan favorite Wolverine (Hugh Jackman, in splendid form, both in his physique and wise-cracks) is sent back in time to prevent a catastrophic event. While the set-up is simple, the execution is anything but, as the narrative takes sudden turns in directions you can’t possibly see coming. (Hint: Mutants are a stubborn lot.) Jackman, Fassbender, Jennifer Lawrence and especially McAvoy give extraordinary performances that root the requisite blockbuster action in deep, resonant emotions.

The film has its impenetrable moments — I still have no clue what happened in the cluttered opening sequence, and its subsequent explanation left me and my comic book-astute companion in equal states of befuddlement — but Singer mostly keeps tight narrative control over an increasingly complicated plot, showcasing his directorial gifts in a magnificent climax that shuttles between two timelines with artistry.

Singer focuses the story on a few key characters, wisely avoiding the temptation to dump every mutant into the fray. There are several newcomers, however, including Evan Peters as the lightening fast Quicksilver. Quicksilver gets one major scene in the film and it’s a flat-out showstopper. Let’s hope Peters, whose droll, apathetic portrayal marks a stark contrast to every other mutant’s hyper-intensity, finds his way back to the X-Men universe. He’s a welcome addition to the X-family.

X-Men: Days of Future Past is rated PG-13 and opens Friday at area theaters.