The tree at Bodh Gaya is not the one the Buddha sat under, but its descendants have been replanted on the same spot more than once.
A lineage of cuttings
The original Bodhi Tree is said to have been destroyed more than once, including deliberately by a hostile queen according to tradition. A cutting had already been sent to Sri Lanka in the third century BCE, traditionally by the monk Sanghamitta, where it grew at Anuradhapura; a sapling from that tree, or its descendants, was later brought back to Bodh Gaya to replace the original, so the tree standing there today is a returned graft of a graft.
Ashoka's temple
The Mauryan emperor Ashoka is credited with the first shrine at the site in the third century BCE, after his own conversion to Buddhism. The current Mahabodhi Temple, a tall stepped tower over the diamond throne marking the spot of enlightenment, dates in its present form largely to the Gupta period and later restorations, having fallen into disrepair and been rebuilt across the centuries as Buddhism's fortunes in India rose and fell.
A working shrine again
After centuries of neglect following the decline of Buddhism in India, the temple was restored under British colonial administration in the nineteenth century and is now an active pilgrimage site for Buddhists worldwide, inscribed by UNESCO in 2002.