Not the food but it’s the first form of treatment to prevent injuries. It’s basically common sense and most peeps use this method of treatment already without actually knowing it.
The acronym R.I.C.E. stands for: Rest, Ice, Compression and Elevation.
Rest is necessary so you don't stress the injury more. So stop, sit down, if necessary and rest.
Ice applied against the injury will reduce swelling and internal bleeding. As opposed to heat, coz it may increase the problem. A pack of frozen peas will do just the trick.
Compression will also reduce swelling, such as wrapping your leg with an elastic bandage.
Elevation will limit fluid buildup. So relax and put you feet up and raise the injured part higher than your heart whilst lying down.