It’s caused by an imbalance in your electrolytes.
You need sodium, potassium and magnesium (in particular)
For sodium, make sure you are eating plenty of salt. Cook with it and add it to your food. You can also make a hot drink using Oxo or Bobril or Marmite - or bouillon, as @Kerplunkk says.
You could also dissolve salt in a glass of water, and add some lemon juice.
Lo-salt (which you can use like ordinary salt) aid good for potassium.
Food sources for these electrolytes include salmon, avocado, spinach and full fat yoghurt.
Alternatively, you can buy electrolyte supplements - High5 make one called Zero, which you can buy from their website, or Amazon, or places like Evans Cycles or Holland & Barrett.
But make sure you keep your fat intake high, as well as all the water. And it should pass quickly.