Tree-dwelling animals can ‘climb’ away from climate change, study finds