1. A method implemented in an electronic device serving as a software-defined networking (SDN) controller in a network containing a plurality of network elements, each network element containing a forwarding table for forwarding traffic, the method comprising: sending messages to the plurality of network elements from the electronic device, wherein each message contains a message identifier, wherein the message identifier indicates an order of the messages, wherein the network elements utilize at least some of the messages to update forwarding tables of the network elements, wherein the network elements capture consistent states of forwarding tables of the network elements, and wherein each consistent state is associated with one message identifier; receiving a set of values from each of the plurality of network elements, wherein each of the set of values is associated with one consistent state for one network element; receiving a request to recover the network to a previous state; identifying a consistent state of forwarding table for each of the plurality of the network elements utilizing the message identifiers associated the consistent states, wherein the identified consistent states represent the previous state of the network without the identified consistent states being captured at the same time at the plurality of network elements; indicating the identified consistent state for each of the plurality of the network elements to a corresponding network element, wherein the corresponding network element updates its forwarding table to match the identified consistent state if its forwarding table is inconsistent with the identified consistent state.