Fun @matrix experiment of the day: if you wipe most of your history by setting a retention of 3 minutes instead of 3 months by mistake (which will delete every message older than 3 minutes on your instance), and grow back that limit to 1 year, your instance will self-heal by retrieving the federated events from other instances.
Of course, this only works for federated events (i.e. not rooms with only members from your instance) and if at least another instance still has the events.