Shares of Dollar General (DG -1.34%) were among the winners last month as the discount retailer soared on better-than-expected results in its first-quarter earnings report and benefited from an upward trend in the stock market over the rest of the month.

In the end, it was enough to push the retail stock up 18% for June, according to data from S&P Global Market Intelligence.

As you can see from the chart below, nearly all of the stock's gains came on the earnings report early in the month.

DG Chart

DG data by YCharts

Dollar General has some good news

Dollar General had historically been a strong performer on the stock market, but it plunged in 2023 as its growth and profits fell. However, the stock now seems to be regaining its footing after starting to implement its "Back to Basics" plan and benefiting from changing consumer shopping patterns.

The company showed off these trends in its first-quarter earnings report as same-store sales ticked up 2.4%, driving net sales up 5.3% to $10.4 billion, which beat estimates at $10.29 billion.

Dollar General benefited from initiatives it took as part of its Back to Basics plan, including reducing out-of-stocks and ensuring that the point-of-sale area was adequately staffed, but management also said that it was benefiting from consumers' trading down in an apparent response to concerns about tariffs and a weakening economy.

After several quarters of declining profits, Dollar General reversed course, posting a 5.5% increase in operating profit to $576.1 million, and earnings per share was up 7.9% to $1.78, which topped the consensus at $1.49.

It also raised its guidance for the year as it now sees revenue growth of 3.7% to 4.7%, up from 3.4% to 4.4%, and earnings per share of $5.20 to $5.80, up from an earlier range of $5.10 to $5.80.

The rest of the month was mostly uneventful for the retailer, though Goldman Sachs downgraded the stock from buy to neutral on June 24, and the stock shrugged off that downgrade.

An aisle in a discount store.

Image source: Getty Images.

What's next for Dollar General

The retailer appears to be benefiting from the current macro environment and is getting back on track after the latest report. While the company still has work to do to execute on the turnaround, Dollar General has a lot of upside potential over the long term, as the stock would double just by getting back to its previous peak.