Pinus yunnanensis (Pinaceae) is an endemic tree species that only can be found in southwest China, it is also a native suitable for afforestation in this region. However, the natural forest of P. yunnanensis has been widely degraded due to long-term external disturbances, resulting in the formation of monoculture forests. Based on species across different strata in natural forest data from three P. yunnanensis vegetation types, evergreen mixed coniferous broad-leaved forests (MECF), mixed deciduous coniferous broad-leaved forests (MDCF), and evergreen coniferous forests (ECF), we evaluated the taxonomic and phylogenetic alpha (α) and beta (β) diversity among three P. yunnanensis vegetation types and determined the optimal ecological P. yunnanensis community configuration. The results showed that a total of 121 plant species belonging to 33 families and 55 genera were recorded, including 49 and 72 species in the tree and shrub layers, respectively. The taxonomic and phylogenetic α diversity was highest in the MDCF in both tree and shrub layers, indicating these forests’ richness in species variety and evolutionary history. The taxonomic β diversity was highest in MECF and ECF in the tree and shrub layers, respectively, while phylogenetic β diversity was highest in ECF and MDCF. Based on an upset plot analysis, we found that the P. yunnanensis-Alnus nepalensis community within the MDCF exhibited the highest α and β diversity. For Pinus afforestation, we recommend a species mix that including P. yunnanensis (a dominant species), Alnus nepalensis (a dominant and nitrogen-fixing species), Quercus griffithii (a deciduous broad-leaved species) and Rhododendron (a regional endemic). Our findings support the notion that mixed forests possess greater diversity and highlight the importance of considering multi-species combinations in ecological restoration, including mixed species with different leaf life habits (evergreen versus deciduous) species and the endemic species of this region. Our findings also have a direct implication for forest management and afforestation and reforestation practices. Subjects: Biodiversity, Ecology, Plant Ecology