That’s the plot of “Twelve Monkeys”, a fine film by Terry Gilliam starring Bruce Willis.
The “Twelve Monkeys” book by Elizabeth Hand was the basis for the movie.
It is a classic by an excellent writer.