Enhancing green resilience is an important element in realizing environmental protection and green development, and with the continuous development of digital technology, digital transformation has become a new driving force for enhancing green resilience. Based on the panel data of 31 provinces in China from 2013 to 2021, this study examines the impact of digital transformation on green resilience. The results show that digital transformation can significantly enhance green resilience, and this conclusion is still valid after considering a series of robustness tests and endogenous problems; the heterogeneity analysis shows that in the eastern and central regions, the enhancement of green resilience by digital transformation is still significant, while in the western region, digital transformation has curbed green resilience but is not significant; both resource-based and non-resource-based provinces’ digital transformation has enhanced green resilience, and the enhancement is more significant in resource-based provinces; in different levels of green resilience, digital transformation has a stronger impact on provinces with high levels of green resilience, showing the “Matthew effect”; the mediation effect results show that digital transformation can enhance green resilience by attracting government investment, fostering industrial integration and increasing public environmental concern; the threshold results show that digital transformation contributes to green resilience across the sample. However, with the development of digital platforms, the growth rate of digital transformation on the promotion of green resilience will first increase and then gradually decrease and eventually rebound, showing an “N-shaped” relationship.