Nowadays, varied application environments require lithium-ion batteries to have self-healing capabilities so that they can avoid the breakage caused by volume changes during using and reach better safety, reliability, and longer cycle life. Herein, an ionic liquid filled polymer gel electrolyte IL-PEO was proposed, prepared by a simple method and process, the gel electrolyte exhibits significantly enhanced mechanical strength and demonstrates good resistance to heat, high ionic conductivity (1.05 × 10−3 S cm−1, 30°C) and Li transference number. The research show that the addition of BMIM-TFSI promoted the construction of SEI layer and effectively inhibited the growth of lithium dendrites in the gel electrolyte. The LiFePO4 / Li cells with IL-PEO-10 exhibited excellent cycling performance (initial specific capacity of 161.3 mAh g−1 and 94 % capacity retention after 100 cycles) and good rate performance. Most importantly, IL-PEO is able to heal the damage in LiFePO4 / Li batteries at 25 °C and restore the performance, thus improves the stability and safety of the batteries.