Sir Philip Barton remained on holiday for 11 days after the Taliban seized Kabul, returning the day before the UK ended its evacuation of civilians.
It comes after a whistleblower said the UK evacuation had been chaotic and dysfunctional.
Sir Philip told MPs his presence would not have led to more people evacuated.
The UK airlifted 15,000 people out of Afghanistan, after the Taliban took control of the capital Kabul in August, including 5,000 British nationals, 8,000 Afghans and 2,000 children.
But whistleblower Raphael Marshall said up to 150,000 at-risk Afghans applied to be evacuated - and fewer than 5% received any assistance.
In written evidence to the Foreign Affairs Committee, Mr Marshall said some of those left behind had since been murdered by the Taliban.
Speaking to the committee on Tuesday, Sir Philip said it was not clear Kabul would fall so quickly - but he refused to say when he booked his holiday.
"If I had my time again I would have come back from my leave earlier than I did," Sir Philip told MPs several times.
On one occasion, Sir Philip was interrupted by committee chairman and Conservative MP Tom Tugendhat, who told him: "It sounds less credible every time you repeat it. It sounds platitudinous."
And Conservative MP Alicia Kearns told the senior civil servant: "I don't think it is enough to say, 'mea culpa'. How in two weeks did at no point, you go, 'I can't, I have to go in and protect my people'?"
Sir Philip, who is the permanent-under secretary at the Foreign Office, insisted cover arrangements were in place and he had "stayed in touch with the department all the way through the period".
His leave partly coincided with that of the then foreign secretary Dominic Raab, the prime minister and other key civil servants.
Sir Philip said he did not "recognise" claims by Mr Marshall that civil servants dealing with the evacuation only worked office hours and worked from home.
"There isn't a clocking-off culture in the [department]," he said.
Elsewhere in the session, Labour MP Chris Bryant confronted Sir Philip and two other senior officials with a letter he said appeared to suggest charity workers and animals were cleared for evacuation from Afghanistan by Boris Johnson.
The letter was reportedly from Mr Johnson's aide Trudy Harrison MP to animal charity boss Pen Farthing.
The prime minister previously denied intervening to help the charity - and the three senior civil servants repeatedly said pets were not prioritised over people.
Downing Street later said Ms Harrison was acting in her capacity as a constituency MP.
After the session, Mr Tugendhat said there had been a "lack of leadership, urgency and adequate resourcing" in the evacuation from Kabul.
The key issues flagged by Mr Marshall, a former senior desk officer who has since quit, include:
* Nobody in the team dealing with requests had studied, had any detailed knowledge of Afghanistan, or had ever worked there
* No one spoke any Afghan languages, with calls to people asking for help conducted in English
* Decisions about who to rescue were arbitrary, and thousands of emails pleading for assistance were not even read
* The IT system was dysfunctional, with eight soldiers drafted in to help left sharing one computer
* Dominic Raab was slow to make decisions on difficult cases and did not fully understand the situation
* Animals from the Nowzad charity run by a former Marine were not in danger and evacuating them was at the direct expense of people at risk of death.
Mr Raab told the BBC lessons would be learned but the UK did a good job compared to other countries.
He said the two-week evacuation was "the biggest operation in living memory" of its kind and the UK had helped a larger number of people than any nation except the US.
The former foreign secretary, who is now justice secretary, said the criticism of his decision-making was from a "relatively junior desk officer" but the main challenges were in verifying the identities of applicants on the ground and safely escorting them to the airport in Kabul, not in making decisions from Whitehall.