The mammary gland redevelops to the prepregnancy state during involution, which shows the mammary cells have the characteristics of remodeling. The rapidity and degree of mammary gland involution vary across species (e.g., between model organism mice and dairy livestock). However, the molecular genetic mechanism of involution and remodeling of goat mammary gland has not yet been clarified. This work investigated the structural changes and transcriptome characteristics of the mammary gland tissue of nonlactating dairy goats during the late lactation (LL), the dry period (DP), and late gestation (LG). Terminal deoxynucleotidyl transferase dUTP nick-end labeling (TUNEL) staining revealed significant changes in the structure of the nonlactating goat mammary gland, and obvious cell apoptosis occurred at LL and DP. Sequencing identified 1,381 genes that are differentially expressed in mammary gland tissue at the 3 developmental stages. Genes related to cell growth, apoptosis, immunity, nutrient transport, synthesis, and metabolism exhibited adaptive transcriptional changes to meet the needs of a new set of mammary gland lactation functions. The significant enrichment of Gene Ontology terms such as humoral immune response, complement activation, and neutrophil-mediated immunity indicates that the innate immune system plays an important role in maintaining the health of degenerative mammary glands and eliminating apoptotic cells. The peroxisome proliferator-activated receptor signaling pathway plays an important regulatory role in lipid metabolism, especially the adaptive changes in expression of genes encoded lipid transport and enzymes, which promote the formation of milk fat during the lactation. The mammary gland development gene module revealed that pregnancy hormone receptors, cell growth factors and their receptors, and genes encoding insulin-like growth factor binding proteins regulate the physiological process of mammary gland involution through adaptive transcriptional changes. Interestingly, ERBB4 was identified as the hub gene of the network that regulates mammary gland growth and development. Overexpression of ERBB4 in mammary epithelial cells cultured in vitro can reduce cell cycle arrest in G1/S phase and apoptosis by regulating the PI3K/Akt signaling pathway and promote the proliferation of mammary epithelial cells. The gene ERBB4 also affects the expression of genes that initiate mammary gland involution and promote mammary gland remodeling. These findings contribute to an in-depth understanding of the molecular mechanisms involved in mammary gland involution and remodeling.