The temples were built by Ramesses II, in Nubia, facing south — a deliberate statement of Egyptian power aimed at everyone coming north up the river.
They were lost to sand for centuries and rediscovered in the early nineteenth century, buried nearly to the heads of the colossi.
When the Aswan High Dam was built in the 1960s, the reservoir behind it would have drowned both temples. In an international rescue operation coordinated by UNESCO, the entire complex was cut into more than a thousand blocks, lifted, and reassembled sixty-five metres higher and two hundred metres back from the water, inside an artificial hill built to replace the cliff. The sun alignment was recalculated and reproduced, though it now falls a day later than it originally did. If you look carefully at the statues you can see the seams.
The temples of Philae, at Aswan, were moved in the same programme.