You're describing the X-Men: The Animated Series episodes Time Fugitives (Part 1) and Time Fugitives (Part 2).
Part 1 opener
Cable and Clan Chosen are fighting Apocalypse and his robots in the year, 3999 AD until a temporal storm devastates the city. Cable questions his A.I. about what's happening and it explains how Bishop travelled to the past and stopped a disease from spreading, meaning mutants would die. It further goes on to explain hoe Cable's timeline is going to cease to exist.
Part 2 ending
Back at the X-Mansion, Beast examines Wolverine and finds that he has fully recovered from the plague, providing the anti-bodies Cable needed to save his timeline. Cable returns to his timeline to find that everything is restored to as before and Tyler is safe.