Mr. Mxyzptlk shows up at Kara's doorstep.
He cannot use any of his powers unless it's to help the people he has wronged, like Kara.
Mxyzptlk offers to send Kara back in time so she can tell Lena she's Supergirl.
Kara sends him back to the fifth dimension with a recording that he gives her of him saying his name backwards.
Kara brings him back so that she can change history.
Mxyzptlk sends Alex and J'onn away to play paintball.
Him and Kara look back at relevant parts of her life, only stopping when Kara believes it to be a good time to tell Lena that she is Supergirl.
Once she has, she goes back to watch the events unfold with Mxyzptlk.
The first time, she tells Lena before Mercy attacks. Lena goes to Metropolis to talk about it with Sam, resulting in her not being able to save Kara from the Agent Liberty attack. Kara dies.
The next time, Kara tells Lena before they get into the fight about Lena making Kryptonite.
As a result, Lena doesn't help her and the DEO fight the Worldkillers.
Kara has Mxyzptlk send her to that time so that she can get advice from Mon-El.
Kara and Mon-El fight Reign. Lena shows up to defeat her without Kryptonite, but Reign kills Lena and Mon-El.
The next time, Kara is sent back to when Lena tells Kara that she didn't come to National City to make friends. She tells her she's Supergirl.
Everything goes well until Ben Lockwood kidnaps Lena
He wants to get revenge on Supergirl because his whole family killed themselves because they thought Supergirl would save them.
Ben wants Supergirl to reveal her identity to the world, and she does. Kara saves Lena.
As a result, Agent Liberty and his followers kill all of Kara's friends.
Kara asks Mxyzptlk to show her a world where her and Lena aren't friends.
They get stuck in that reality.
When Lena cape to National City, Lex tried to kill her. She was injured and disappeared for two years. She came back and killed Lex, along with half of National City
She rules over what's left with Reign as her enforcer. She captured Brainy and aligned him with her.
Lena tapped into the fifth dimension to power her police robots, which is why Mxyzptlk is powerless.
Winn knows of a guy with a hat that was stolen from Mxyzptlk that contains a lot of fifth dimension energy. Them and Mon-El go to find it.
Kara confronts Lena while everyone else fights off Reign and Brainy.
J'onn kills Reign.
Winn finds the hat and Mxyzptlk sends him and Kara back to their reality.
Kara decides she's done and tells Mxyzptlk that he is free.
Kara visits Lena and tells her that she is done blaming herself for Lena's actions and Lena will be held accountable for any of her decisions.