Enhancing the livelihood resilience of livestock farmers in the old revolutionary base areas helps them to cope with the increasingly complex external risk shocks of recent years and promotes the sustainable development of regional agriculture. This study is based on survey data from 1047 livestock farmers in the Ningxia and Gansu provinces of the northwest old revolutionary base area. It incorporates the characteristics of livestock farmers and the elements of psychological capital into the sustainable livelihood analysis framework to construct a livelihood resilience index system. After measuring livelihood resilience, this paper uses a general linear regression model and a probit model to explore the impact and mechanism of digital literacy on the livelihood resilience of livestock farmers. The results show the following: (1) digital literacy has a significant positive effect on the livelihood resilience of livestock farmers, and the impact of different dimensions of digital literacy on different dimensions of livelihood resilience also varies. Additionally, this effect also shows the heterogeneity in different village clustering forms and different income groups. In areas inhabited by ethnic minorities and among moderate-income groups, the role of digital literacy on the livelihood resilience of livestock farmers is more significant. (2) The improvement of digital literacy has a significant positive impact on livelihood resilience through three different pathways: the “differential mode of association”, learning channels, and types of income. (3) Digital literacy has led to the psychological aspects of rural hollowing-out problems among livestock farmers, which is particularly evident in families with only one type of caregiving burden (either only left-behind elderly people or only left-behind children). This problem is more evident. Therefore, this paper poses that the advancement of agricultural and rural economic development in China should not only focus on the cultivation of farmers’ digital literacy but also accelerate the construction of digital infrastructure to ensure the long-term effective mechanism of improving digital literacy. At the same time, in the process of promoting digital rural areas, attention should be paid to the psychological isolation issues that the network era brings to farmers.