The public overreacted to Chipotle's (CMG 1.85%) E. coli scandal.

Yes, hundreds of people got sick, and panic in the immediate aftermath was not unwarranted, but the length of time people stayed away was extreme. The Mexican chain's problems began in July 2015 but escalated with a nine-state E. coli outbreak in December 2015.

At the time, consumers became worried that they too would get sick if they ate at Chipotle and began to stay away. The company saw its sales plummet, its stock price fall, and consumer trust in the brand drop dramatically.

In many ways, the negative backlash was magnified by the fact that the chain had always held its food up as better than what its rivals offered. When you use the tagline "Food with Integrity," you're not telling consumers you're immune from problems, but it seems clear that some of the public took it that way.

Even though Chipotle took aggressive steps to address the food safety concerns, including creating new procedures and closing for an afternoon to train staff, consumers stayed away in 2016. For the full year, the company posted a 13.3% drop in revenue and a comparable-store sales decline of 20.4%, and earnings per share (EPS) fell to $0.77, down from $15.10 the prior year.

CMG Chart

Image source: YCharts.

Get ready for a comeback

Not long after the chain's October E. coli outbreak, I wrote a piece predicting its eventual comeback. I noted at the time that Burger King had recovered fairly quickly from a 2013 scandal where a supplier it was using was selling it hamburger patties laced with horse meat. Yum! Brands Taco Bell also bounced back rapidly from a Salmonella outbreak that sickened 68 people in 10 states in 2011.

Those stores were both big news, and the scandals' impacts were short-lived. I expected the same thing to happen in the case of Chipotle, but my timing was off. In this case, consumers held a grudge, and the food-safety scandal affected results for over a year.

As you can see on the chart above, though, after a long post-scandal period of dropping, Chipotle stock has begun to recover. That's because consumers have begun to forgive (or perhaps forget), and all of the reasons the company was once an industry leader have come back into focus.

A line at a Chipotle

Consumers are returning to Chipotle. Image source: Chipotle.

How is Chipotle doing?

The chain has lapped its bad year and will be facing easier comps for 2017. That paid off in Q1, when the company reported a 28.1% jump in revenue, a 17.8% increase in comparable-store sales, and EPS almost doubling to $1.60 from $0.88 in the same quarter a year ago.

"2017 is off to a strong start, as our restaurant managers and teams are energized by our renewed focus on the customer," said CEO Steve Ells in the earnings release.

It's important to note that Chipotle has not merely increased its focus on food safety, it has also invested heavily in technology in order to improve customer service in its restaurants. Ells celebrated that in his remarks as well:

By simplifying the focus in our restaurants to only those elements that lead to a great guest experience, our operations have improved every single month, which gives us confidence that we are on our way to achieve our mission to ensure that great food made with whole unprocessed ingredients is accessible to everyone.

The chain forecasts that full-year comparable-store sales will grow in the high single-digits. In addition, Chipotle expects to add 195-210 new locations in 2017.

Chipotle is a buy

While its stock has begun to recover, Chipotle shares remain at a heavy discount. The company paid the price for its E. coli issues, which were perhaps magnified by the hubris of its tagline and the scrutiny of the internet era, but it has emerged a stronger restaurant chain.

Before the scandal, Chipotle had create a category where consumers paid more for fast-food because of the perception of value created by higher quality. The company still offers that. It has better, fresher food than its fast-food rivals, and equal or better than its fast-casual competitors.

Post-scandal, the company has also upped its technology game, adding app-based ordering and a second production line to serve those orders in many locations. It may not be a steady rise back to the heights the company once reached, but Chipotle did not stop being a compelling restaurant chain just because some people got sick.

The company has put its problems behind it, and people have begun coming back, Eventually, along with the continued evolution of the brand, that should mean Chipotle will go back to being the strong performer it was before the E. coli scandal.