Where and how to restore in a changing world: a demographic-based assessment of resilience