My mare used to rear when she got frustrated/confused.
She didn't rear straight up, but she's quite a pro at little half rears.
Every time she did it I'd urge her forward, do a few small circles(once all 4 feet were on the ground), and then have her back up. Basically trying to get her to calm down with stuff she already knows.
Now whenever she gets frustrated/confused she'll slowly back up on her own. Lol
It's probably not the right thing to do, but it worked with my horse.
And it's been years since she's tried it last.