Everything pre First Class was on timeline A. First Class onwards is a slightly different timeline B.
Even though the two are VERY similar, they're not the SAME timeline. The Xmen use the same time travel as Marvel and DBZ: you're going back (or forward) to a SIMILAR timeline, not necessarily actually your's.
Now Days of Future past happens. Stuff that's current day on the First Class timeline (but didn't impact the original movies tooo much) turns out to be awful in the long term. The timeline A gang send wolverine to the very similar Timeline B to change stuff. They time travel like Kingdom Hearts: you go into a sleep and wake up in your actual body in the past.
When Wolverine body jacks himself, he changes the timeline enough that the sentinels don't become stupid strong. That's pretty much the main thing he does. He saves timeline A, and when he wakes up he's in the future of timeline B that he created.
Timeline B could have still wound up being pretty similar to A, but stuff like Apocalypse, for example, would have probably still happened.
Maybe wolverine obliterated timeline A, where they would have all died anyways, or maybe they all died but he got to survive in the future of timeline B.
Either way, I'm almost positive Logan is wolverine bodyjacked by himself from an alternate timeline in the future of the First Class timeline. So if you go far enough forward the mutants still get wrecked, but just a different kind of wrecked instead.