For acute injury management (first 72 hours after tear/sprain/bruise/fracture), conventional wisdom says that ice will slow the rate of blood flow, meaning less bruising and swelling. This is preferable to heat which increases blood flow, meaning worse bruising etc.
However, if you’ve hurt your back, hips or shoulders, often the inflammation or swelling is far too deep to be affected by ice. The cooling effect only penetrates 5-6mm into your tissues, below which your circulation warms them back up, so if the injured structure is any deeper than this then ice simply wont work.
In this situation, heat will relieve muscular spasm and pain, while cold will tend to make tight muscles more tight. So, if you injure a peripheral joint or muscle (elbow, knee, wrist, ankle), or there is VISIBLE swelling, then ice for 10 mins every hour. If you injure a central joint or your spine, you’ll get more relief from a wheat-bag or hot water bottle.