As the next generation of green power system, smart grids have gradually enhanced the operation efficiency of power system. Meanwhile, the application of communication and intelligent technologies make the power grid more vulnerable to the emerging cyber‐physical attacks, such as the false data injection attack (FDIA). Particularly, the deception property of the FDIA on the output measurement estimation can fool the current security mechanism without triggering an alarm. Motivated by this problem, this paper aims at developing a novel detection and recovery mechanism against FDIA in smart grid. Based on the established state space grid model derived from the three‐phase sinusoidal voltage equations, an improved principal component analysis (PCA)‐based detection method is proposed. By introducing the mathematical transformation principle method, the detection performance such as detection rate and false positive rate can be improved. To keep the stable running of power system, a genetic optimization algorithm‐based linear quadratic regulator (LQR) defense method is developed. In addition, to improve the response performance to external attacks, an artificial intelligence method named genetic optimization algorithm is introduced to optimize the robust performance of the proposed defense method. Finally, the simulation results on the IEEE 6‐bus and 118‐bus grid system demonstrate the superiority of the proposed genetic algorithm optimization‐based LQR defense method.