Milan had been in negotiations with Manchester City throughout January over a move for the Argentinian with the Barclays Premier League club insistent any deal would be permanent, ruling out a loan.
Galliani had said earlier this week that should they fail to acquire Tevez they would instead sign Maxi Lopez and earlier on Friday they registered the former Catania striker's signing with the Italian league.
Galliani then confirmed that the Serie A champions would not be signing Tevez.
He told Milan Channel they had set a deadline of 1900 local time for a final decision and said: "At 1830 I was convinced we were very close to sealing the Tevez deal.
"I did my best, it was a day where I had my heart in my mouth, but no more could be done.
"We had everything set for Tevez to come, but the situation changed."
However, Galliani admitted it did not spell an end to Milan's interest in Tevez, who has been in his native Argentina without the club's permission since November having not played for them since September.
He added: "Who knows with Carlitos - there is only a few months (until the summer transfer window )and that's it.
"I'm happy with how we are left with City, we have a very good relationship.
"Today [Friday] was still very important because we have solved some misunderstandings of recent days with City, relations are much improved.
"But, patience, life goes on. The market will reopen in four months, we'll see."
Milan's city rivals Inter as well as French side Paris St Germain had also been linked but withdrew their interest and for Tevez it would appear he has no way out of the Etihad Stadium this month with the transfer window drawing to a close.
That fact was underlined by Tevez's advisor Kia Joorabchian, when he said in an interview with talkSPORT that his client could remain at City until the next transfer window.
"We've been in negotiations with three big clubs," said Joorabchian.
"I don't think anyone has reached the numbers City were hoping for.
"At the moment it looks like Carlos will remain at City until this summer."
Galliani however welcomed Lopez to the San Siro after the Argentinian arrived on loan from Catania.
He said: "With Maxi I kept my word: we had a deadline of 7pm today [Friday], and since we had not reached an agreement with City we have filed Lopez's signing with the league.
"He is a very important player.
"We can use him in the Champions League."