Software-Defined Networking (SDN) benefits from the development flexibility of control-plane applications (SDN-Apps), which allows third parties to make contributions. Such flexibility may expose SDN networks to security threats, since SDN-Apps may be malicious or prone to implementation bugs. These buggy/malicious SDN-Apps may contaminate the data plane with abnormal network actions, which may not be prevented before they are committed to the data plane. This contamination may lead to network crash or poor network performance. We thus present ReSDN, a lightweight solution for data-plane state recovery, to recover an SDN data plane from a contaminated state. It requires neither switch modification nor the intervention of SDN-Apps, both of which current recovery solutions rely on. It leverages the concept of FP-tree (Frequent Pattern tree) to maintain the dependency of event transactions and network actions to achieve correct recovery. Our evaluations validate the viability of our ReSDN design, and show that it can recover more than twice as fast as the other type of recovery approach, rollback recovery.