Taking warm showers always helped me when I'd hurt my breasts and/or nipples.
One thing I did after I had my piercings was to bandage my nipples with a little tape and gauze, it seriously helped to keep me from hurting them when they touched anything. That may not be a long term solution, but it might help for when you accidentally whack one.