Heating technologies have come a long way. Keeping warm is a basic need that serves both survival in nature and more recently, comfort in modern societies. Today, heat pumps have become one of the most commonly used heating and cooling systems used world wide.
The Beginnings of Heat Pumps and Refrigeration – William Cullen
William Cullen appears to have been the first person too discover the scientific principals that were later used to create both heating and refrigeration technologies. However at the time, no commercial application was able to be created to make use of these principles.
Peter von Rittinger
Another important contributor to heat pump development was Peter von Rittinger. In 1856 he came to understand how a heat pump might work via conducting experiments that demonstrated that water vapor’s latent heat could be used for evaporating salt brine. 
Robert C. Webber’s Contributions to Heat Pump Development
Robert C. Webber, an American inventor came up with the idea for a ground source heat pump when he was doing some experiments with his deep freezer. Having burnt his hands touching the outlet pipes of the cooling system, he wondered whether he might be able to reverse the mechanics. “He connected the outlet piping from a freezer to a hot water heater and, since the freezer was producing a constant excess heat, he hooked up the heated water to a piping loop”.
Via this work he has been credited with developing the first ground heat pump system 
Todays Heat Pumps
Today’s heat pumps provide sophisticated systems for both heating and cooling homes and commercial premises. To do this, the system carries the capability to reverse the direction of refrigerant and therefore deliver either heating or cooling to a building.
 William Cullen, Of the Cold Produced by Evaporating Fluids and of Some Other Means of Producing Cold, in Essays and Observations Physical and Literary Read Before a Society in Edinburgh and Published by Them, II, (Edinburgh 1756)
Banks, David (August 2012). An Introduction to Thermogeology: Ground Source Heating and Cooling. John Wiley & Sons. p. 123.