Understanding the evolutionary history of endangered species is crucial for identifying the main reasons for species endangerment in the past and predicting the changing trends and evolutionary directions of their future distribution. In order to study the impact of environmental changes caused by deep valley incision after the uplift of the Qinghai-Tibet Plateau on endangered species, we collected 23 samples belonging to four populations of Aleuritopteris grevilleoides, an endangered fern endemic to the dry-hot valleys (DHV) of Yunnan. Single-nucleotide variation sites (SNPs) were obtained by the genotyping-by-sequencing (GBS) method, and approximately 8085 SNP loci were identified. Through the reconstruction and analysis of genetic diversity, population structure, population dynamics, evolution time, and ancestral geographical distribution, combined with geological historical events such as the formation of dry-hot valleys, this study explores the formation history, current situation, reasons for endangerment and scientifically sound measures for the protection of A. grevilleoides. In our study, A. grevilleoides had low genetic diversity (Obs_Het = 0.16, Exp_Het = 0.32, Pi = 0.33) and a high inbreeding coefficient (Fis = 0.45). The differentiation events were 0.18 Mya, 0.16 Mya, and 0.11 Mya in the A. grevilleoides and may have been related to the formation of terraces within the dry-hot valleys. The history of population dynamics results shows that the diversion of the river resulted in a small amount of gene flow between the two clades, accompanied by a rapid increase in the population at 0.8 Mya. After that, the effective population sizes of A. grevilleoides began to contract continuously due to topographic changes resulting from the continuous expansion of dry-hot valleys. In conclusion, we found that the environmental changes caused by geological events might be the main reason for the changing population size of A. grevilleoides.