A small recovery in commodities and a rally in companies that make consumer staples like toilet paper and pasta helped the financial markets reverse a decline Thursday to end the day with modest gains.

A small recovery in commodities and a rally in companies that make consumer staples like toilet paper and pasta helped the financial markets reverse a decline Thursday to end the day with modest gains.