Gastric ulcer (GU) is currently one of the most serious and common gastrointestinal diseases worldwide, severely affects the quality of life of patients. However, treatment strategies have limitations, such as drug safety and lack of repair specificity. In this work, we developed a polyethyleneimine/polyacrylic acid/lactose-modified chitosan (PPCL) hydrogel to repair gastric ulcers. This hydrogel was characterized by robust tissue adhesion, low swelling rate, gastric acid fluid resistance, potent antioxidants and good biocompatibility, which could act as a physical barrier to prevent gastric acid and digestive enzymes from further destroying ulcers. In vivo data from a rat GU model confirmed that this hydrogel effectively promoted gastric ulcer healing, and the therapeutic effect was better than that of commercial gastric mucosal protectants. Further mechanistic research identified that the hydrogel accelerated GU healing by alleviating oxidative stress, promoting reepithelization, angiogenesis and mucosal repair. Our findings revealed that the PPCL hydrogel provides a promising therapeutic approach for healing gastric ulcer.