Angkor Wat is the standard example of a religious site changing tradition without being destroyed, abandoned or seized, and the reason it survives at all.
Built for Vishnu
Suryavarman II commissioned it in the first half of the twelfth century as his state temple, dedicated to Vishnu rather than to Shiva as most Khmer state temples had been. It is the largest religious monument in the world by area.
It faces west, unusual for a Khmer temple. West is the direction of death, and some scholars read this, together with the counter-clockwise reading order of the galleries, as evidence it was also intended as Suryavarman's funerary temple. Others dispute it. The argument is not settled.
The galleries carry narrative relief of the first order, including a churning of the sea of milk running for close to fifty metres.
The change
Khmer religion moved towards Theravada Buddhism over the following centuries. Angkor Wat moved with it.
What did not happen is the point. The temple was not levelled, converted by conquest, or abandoned to the forest. Theravada monks took it over, Hindu images were removed or recarved, Buddha figures were installed, and worship continued without a break.
Some niches emptied of their Hindu images are still empty, which is a plain physical record of the transition.
Why it survives
This is why Angkor Wat is standing while most of Angkor was swallowed. A building in continuous use is maintained, cleared, re-roofed and repaired. The great temples that lost their communities, Ta Prohm, Beng Mealea, are the ones the strangler figs took apart.
Continuous use, not stone, is what preserved it.
The twentieth century
The temple came through the Khmer Rouge period, during which the Cambodian monkhood as an institution was very nearly destroyed: monks defrocked, killed, or forced into labour, and the monastic education system dismantled. The buildings survived better than the people who used them.
UNESCO inscribed Angkor in 1992 and placed it on the List of World Heritage in Danger in the same moment, removing it in 2004. The APSARA authority has managed it since 1995.
Monks are resident again, offerings are made at the images, and the building appears on the national flag, the only national flag depicting a building.