The restoration of forest ecosystems is associated with key benefits for biodiversity and ecosystem services. Where possible, ecosystem restoration efforts should be guided by a detailed knowledge of the native flora to regenerate ecosystems in a way that benefits natural biodiversity, ecosystem services, and nature's contribution to people. Machine learning can map the ecological suitability of tree species globally, which then can guide restoration efforts, especially in regions where knowledge about the native tree flora is still insufficient. We developed an algorithm that combines ecological niche modelling and geographic distributions that allows for the high resolution (1km) global mapping of the native range and suitability of 3,987 tree species under current and future climatic conditions. We show that in most regions where forest cover could be potentially increased, heterogeneity in ecological conditions and narrow species niche width limit species occupancy, so that in several areas with reforestation potential, a large amount of potentially suitable species would be required for successful reforestation. Local tree planting efforts should consider a wide variety of species to ensure that the equally large variety of ecological conditions can be covered. Under climate change, a large fraction of the surface for restoration will suffer significant turnover in suitability, so that areas that are suitable for many species under current conditions will not be suitable in the future anymore. Such a turnover due to shifting climate is less pronounced in regions containing species with broader geographical distributions. This indicates that if restoration decisions are solely based on current climatic conditions, a large fraction of the restored area will become unsuitable in the future. Decisions on forest restoration should therefore take the niche width of a tree species into account to mitigate the risk of climate-driven ecosystem degradation.