Shares of Red Hat stock have recovered all the ground given up last week when a stock downgrade and a war of words with database giant Oracle helped trigger a 7-percent drop in their value.

Bolstered in part through a “buy” rating from Citigroup, Red Hat (Nasdaq: RHAT) shares closed up 70 cents, or 2.36 percent on Tuesday to close at $30.37. At one point during the day, shares traded at $31, nearly matching their 52-week high of $31.05.

Citigroup launched coverage of the software industry by picking eight firms, including Red Hat. The Linux software developer and services provider based in Raleigh was given a target share price of $40.

Red Hat was also identified as one of four “best ideas” by Citigroup, according to Reuters. Also cited were Adobe Systems, Autodesk and The other four firms included in Citigroup’s coverage are: Microsoft, Oracle, Novell and RightNow Technologies.

In trading Wednesday, Red Hat shares closed at $30.25, down 12 cents.

The Oracle-Red Hat dispute broke out on Nov. 17 when Oracle’s top executive Larry Ellison criticized Red Hat, a business partner, in an interview with The Financial Times. (Matthew Szulik, chairman and chief executive officer of Red Hat, fired back at Ellison in a letter to The FT, criticizing proprietary software systems.) That same day, Goldman Sachs cut its rating of Red Hat stock to “underperform”. Red Hat shares sank to $28.51.

The price was the lowest closing point for the stock since Red Hat announced on April 10 that it was acquiring Atlanta-based JBoss. Since JBoss, an open source company, also develops database software, Goldman Sachs said Red Hat could be viewed as a competitor of Oracle and IBM. Both companies work actively with Red Hat.

Red Hat stock climbed 8.8 percent, or $2.42, to close at $29.85 the day the JBoss deal was announced.

(For more about the Oracle-Red Hat dispute, see: .)

Red Hat: