Marty returns home for good, to a timeline very much like the one he'd hoped to restore, with the exception that the ravine is now named "Eastwood Ravine," after he supposedly perished in it in 1885-G. No sooner has Marty arrived back in 1985 than a modern train comes through, smashing the DeLorean to bits while Marty jumps to safety. Although it's bittersweet, Marty realizes that this is what Doc wanted: to have the time traveling be over, the timeline secured, Marty back home, and Doc with his true love.
Marty reunites with Jennifer, and the two of them go for a drive. They're challenged to a race by Marty's future criminal accomplice at a stoplight, but instead of racing, Marty puts his truck in reverse. Watching a Rolls Royce cut into the would-be path of his truck, Marty realizes he would have gotten into a devastating car accident, which Jennifer realizes is the accident that would've cost him his music career. Looking at the fax from 2015-C in which Marty was fired, Jennifer sees that it's been erased.
Marty and Jennifer head back to the site of the wrecked DeLorean, and are shocked when a flying locomotive engine appears out of nowhere. It turns out that sometime after Marty traveled back to the future, Doc stole another train and built a new time machine, which he and Clara are using to travel throughout time. Doc reveals that he and Clara are now married with two young sons, Jules and Verne, after their favorite science fiction author. Doc urges Marty and Jennifer to make the best futures possible, since nothing has yet been written, and then takes off in his train for worlds — and times — unknown.