Sometimes on a difficult uphill, my heart gets pounding too fast and I feel uncomfortable (mine is from exertion though, not panic). When this happens I do a little mental trick of pretending the top half of my body is in a yoga class and is meditating and relaxing, and I let my hips and legs take over the work.
This seems silly, and I don't even do yoga.... but it does work for me to some extent.
I also tell my but and hip muscles to take over from my quads for a minute- that helps too.
The third thing I do is to do with breathing...often when I'm exerting myself on the bike I notice that I've started breathing one breath for each leg stroke, both left and right. Not good. When I catch myself doing this I switch to one fuller more relaxed deep breath per side- like only with the right foot stroke.
I think concentrating on your breathing and thinking about a yoga-like state can help relax panic. Also be sure not to hunch over too much as you are contracting your diaphram that way and can't take in as much breath.