We consider reconstructions of the heliospheric modulation potential (HMP) over the past 20 thousand years based on the radiocarbon data, taking into account changes in the Earth's climate. This time interval includes the process of the end of the last ice age and the transition to the Holocene. Variations of the reconstructed values the HMP (i.e., the activity of the Sun) are compared with the global surface temperature. It is shown that high solar activity could lead to the Mayendorf warming and to the recorded temperature maximums around 7000 and 5300 BC. The drop in temperature between 3000-1000 BC and during the Little Ice Age could be the result of low solar activity.