Simply take a few ice cubes and place them in each dent. Allow the ice cubes to melt overnight. The fibres in your carpet slowly absorb the water, expanding and rejuvenating the pile.
If you have low pile carpet, you might need to use a few ice cubes for it to work.
The dents should have disappeared by the morning. You may need to blot any excess water with a clean cloth.
If you can still see a mark, use a fork to gently fluff the carpet. Otherwise, use the hose attachment on your vacuum to gently lift the fibres.