In 2018, a few weeks after the devastating events caused by Thanos, a group of surviving Avengers—including Bruce Banner, Steve Rogers, Thor, Natasha Romanoff, and James Rhodes—plans to use the Infinity Stones to undo Thanos's actions. However, they discover that Thanos has already destroyed the Stones, so his actions can no longer be undone. In his rage, Thor takes matters into his own hands.
Five years later, Scott Lang proposes a possible solution: time travel. Together with Tony Stark and Rocket, the team decides to retrieve the Stones from the past to change the present. They build a time machine, and the team splits into groups that travel to different points in time to collect the Stones.
During their time-travel mission, they must overcome challenges, experience key moments in the Marvel Cinematic Universe, and interact with past versions of characters. Along the way, they recruit an overweight and disheartened Thor and Clint Barton, who has turned to vigilante justice after the loss of his family.
As they gather the Stones—including encounters in New York City in 2012 and Asgard in 2013—they face emotional and physical challenges. Romanoff makes a sacrifice to obtain the Soul Stone, and the team faces unexpected complications as they attempt to undo Thanos's actions.
When they reunite in the present, the Avengers create a gauntlet to use the Stones and reverse Thanos's disintegrations. However, a version of Nebula from the past—who is loyal to Thanos from 2014—uses the time machine to bring Thanos and his army into the present. A massive battle ensues, in which the Avengers, the Guardians of the Galaxy, and other allies face off against Thanos and his forces.

