Loretta Cornelius, fired Wednesday as deputy director of the Office of Personel Management, said yesterday she will abandon her fight to keep her job and will limit her battle with the administration to congressional hearings.

Cornelius said her lawyer, Joseph Petrillo, was informed yesterday by Richard A. Hauser, deputy counsel to the president, that President Reagan had personally directed her removal. Cornelius had contended that only the president had the authority to fire her and that she would not leave until she was given evidence that he, and not lower level administrators, had acted.

"Yes, Dick's [Hauser's] understanding is that the president did undertake personally that the action be taken and he told [Cornelius'] attorney that," said Albert R. Brashear, a White House spokesman. "The only reason ever stated for the firing is one the president has stated earlier. It is his preference that all Cabinet officers and agency heads have the right to select his own deputy. Mrs. [Constance] Horner [the new OPM director] would like to select her own deputy."

Cornelius, 49, said Horner has transferred Cornelius' staff to other jobs and begun to clear out her office. Cornelius said she still has her office keys and passes, but will not follow through on threats to resist her dismissal by continuing to go to her office.

"I've decided it's better to go the legal route, through my lawyers and through the Congress, than to fight this by going into my office," Cornelius said in an interview. "I'll be much more effective fighting legally against these abuses."

Rep. Barney Frank (D-Mass.), head of the House Committee on Government Operations' subcommittee on employment and housing, which has oversight of OPM, has said that he intends to begin hearings in March on Cornelius' firing.

"What I wanted was to get them to put into writing that they are firing me, and I've got that now," Cornelius said. "What I've been through has been nothing but pure, outright harassment. I was not interested in keeping my position, but in exposing the corruption that has crept into this administration. It is a sad day in this country when a citizen can't go before the Congress and tell the truth without being badgered and discredited."

Cornelius yesterday repeated her assertion that "ultra right-wingers" have continued to harass her because of her Senate testimony last June, which derailed the renomination of former OPM director Donald J. Devine. Cornelius testified that Devine had schemed to continue running OPM after his term expired and then asked her to lie to the Senate about his plan.

After her testimony, Devine withdrew his nomination, although he denied that he had asked her to lie.

The General Accounting Office also found that Devine had "illegally circumvented" federal law by attempting to retain his power when his term expired.

In November, the White House asked Cornelius to resign, as White House sources reported pressure from conservatives to avenge Devine's defeat.

Cornelius said she was offered the lure of a "nice letter from the president" if she would resign, but she said she refused because it is "necessary to stand up against this harassment."