Jan 7 (Reuters) - Australian shares rebounded on Friday from previous session's tech-driven sell-off, with financials and energy stocks leading gains, while James Hardie slumped after the world's top fibre cement maker ousted its chief for breaching code of conduct.

The S&P/ASX 200 index closed 1.3% higher at 7,453.3, but was largely flat this week. The benchmark index tumbled 2.7% on Thursday.

Global markets attempted to recover on Friday from the previous session's battering, sparked by the potential for sooner-than-expected rate hikes by the U.S. Federal Reserve. The sell-off saw investors dump shares of companies that don't do well in a higher-rate environment such as the technology sector.

"After the heavy sell-off yesterday, the paring back of some losses may seem to be playing out," said Yeap Jun Rong, market strategist at retail trading platform IG.

Financial stocks rallied 1.9% after having slumped 2.3% on Thursday, led by the country's four largest lenders climbing between 1.3% and 2.7%.

Energy stocks jumped 2.2% as crude prices inched up on supply worries amid the political unrest in Kazakhstan coinciding with a drop in production from Libya.

The tech sector rose 1.1%, despite a poor show overnight on the Nasdaq, recovering slightly from the previous session's beating where it saw its worst day since March 2020. Buy-now-pay-later leader Afterpay Ltd added 3%.

James Hardie Industries was the biggest drag in the benchmark as shares sank 4.1%. The company said Chief Executive Officer Jack Truong was fired on his work-related interactions over the last several months "extensively and materially" breaching the company's code of conduct.

Meanwhile, the takeover battle for Australian Pharmaceutical Industries ended as it accepted Wesfarmers' A$763.6 million ($546.9 million) bid after top grocer Woolworths Group, which had made a superior offer, backed out.

Australian Pharmaceutical, which is not a part of the benchmark index, plunged 12.4%, while Wesfarmers advanced 0.7%.

New Zealand's benchmark S&P/NZX 50 index edged down 0.1% to 12,970.65.

(Reporting by Harshita Swaminathan; Editing by Sherry Jacob-Phillips)