The extreme deformation and external damage of electrolyte materials during the working period limit its further development in flexible wearable electronics. Thus, the polyurethane-based solid polymer electrolyte (PUSPE) with a shape-memory performance is designed and prepared, possibly controlling the temporary shape and restoring the original shape with the help of the polycaprolactone (PCL) soft segments. Abundant disulfide metathesis and hydrogen bonding in PUSPE also show readily healable ability with heating stimuli. The assembled Li/LiFePO4 (LFP) battery based on PUSPE presents a specific discharge capacity about 160 mAh g − 1 at the charge/discharge rate of 0.1 C, and the capacity retention rate is close to 92.4% after 100 cycles. The as-prepared flexible battery demonstrates an inherent shape-memory performance, which provides the possibility to match with complicated flexible devices.