In Lightroom, how do I get back to a previous state?

Either scroll down to the history panel on the left of the develop panel and find where you want to go, or press Command + Z (mac) or Control + Z (PC) to undo step by step the things you did.