The earliest example I can think of is Groundhog Day - but I really find it hard to believe that no enterprising SF writer had tried something similar before 1993. It seems a kind of obvious device - but maybe only in retrospect?
Anime seems particularly rich in examples: off the top of my head, there's Madoka Magica, Steins;Gate, The Girl Who Leapt Through Time and now (which is what put it in my head again) the recent series Erased (aka Boku Dake Ga Nai Machi) - which I'm about halfway through and very much enjoying.
Anyway, I feel sure I'm missing some obvious earlier examples, or simply showing my lamentable ignorance of them. Feel free to put me right!