I've pinched the ulnar nerve in one of my hands - aside from putting me in a wrist brace, to protect the nerve, my doc sent me and my bike for a professional fit, and to have the shop put cork tape on my handlebars (my doc was a cyclist, which helped). I was riding with padded gloves, but after a 50-mile ride I discovered that a hand didn't work. I had to ride the rest of the season with the wrist brace, just to keep me from re-injuring my wrist. The shop shortened the stem - I was reaching out too far, and adjusted the tilt.

Definitely get your bike professionally fitted (remember to wear your riding kit, and bring your gloves when you go in). Changing hand position while riding is also important.