Herniated disc, what is better, heat or ice?

Herniated Disc. It really depends on the acuteness of the disc herniation. Early in the course of the disease ice might be considered good, however, for chronic disc herniation, heat would be of most benefit.
Either. However, it will be temporary as it takes a lot to get down into the spine which might not work. Sounds like you have a pinched nerve in your back. I would suggest seeing a pain/spine specialist to evaluate you further to evaluate what level and what can be done to treat you. There are interventional treatments besides medications and surgeries that might reduce or eliminate the pain altogether.
Test it. Heat improves circulation (washes out the Lactic Acid from the muscles); while ice chills the tissues and reduces inflammation. Different mechanisms, which one is more helpful cannot be predicted. Try them both and see which one wins.