Tasha Yar was revived as part of an alternate timeline in the Emmy nominated episode Yesterday's Enterprise. When the USS Enterprise-C comes through a time rift from a past in which it was destined to save a Klingon outpost from a Romulan attack, it creates a new timeline in which the Federation is at war with the Klingons. In this new timeline, Yar is alive because the USS Enterprise-D never went to explore the world on which she was killed in the above writeup.

Now here's the fun part. Guinan convinces Yar she shouldn't be a part of the timeline. Yar hops aboard the Enterprise-C and rides with it back in time to fight the Romulans and avert the war. This is the end of the episode, but according to another episode Redemption, Part II, she is taken prisoner by a Romulan commander who then has a daughter by her. The daughter shows up in Redemption as Commander Sela, and confusion ensues. Really, once you introduce time travel into a series of adventures you can never really tell what's what.

This is all well and good, but why -- you may ask -- did Yar keep coming back in some form or another? Well, the answer to that is simple (as compares to time travel anyway). It seems that while the lovely and talented Denise Crosby enjoyed her work on Star Trek she really wanted a movie career, so she went the way of Diane from Cheers and it didn't work out for her either. So she kept coming up with fun ways to come back to the show, and the writers loved it because it let them do some happy crazy continuity bits on the show which is really all Star Trek writers want anyway.