The balance of Th17/Treg plays an important role in hepatic ischemia–reperfusion (I/R) injury. Glycolysis and glutaminolysis for energy metabolism governs the differentiate of CD 4+ T-cells to Th17/Treg. Metformin can regulate glucose metabolism in the liver, but its protective effect on I/R liver injury and its effect on Th17/Treg balancestill unknown. In this study, the I/R liver injury rat model and the primary hepatocyte hypoxia/reoxygenation injury model were established. The biochemical indexes, inflammatory factor indexes, Th17/Treg balance and energy metabolism were evaluated. RNA-seq and gene knockout cells were used to investigated the target protein of metformin. The results showed that metformin could effectively improve liver injury caused by I/R, significantly inhibit the glycolysis, improve the Th17/Treg balance, and inhibit the expression of inflammatory factors. RNA-seq results showed that TIGAR was a possible regulatory site of metformin. However, the protective effect and the regulating effect of Th17/Treg balance by metformin in TIGAR knock-out cells were disappeared. In conclusion, metformin could regulate TIGAR inhibit glycolysis then regulate Th17/Treg balance, inhibit the release of liver inflammatory factors, and finally play a role in inhibiting the occurrence of liver injury caused by ischemia-reperfusion.