Lots of theories about this one, but most of them were the same: The Avengers is going to the Microverse/Quantum Realm using Hank & Professor van Dyne's machine from the Ant Man, and recover the Infinity Stones/Infinity Gauntlet there. They could be gone to either the alternate universe, or even going back to the past, since time & space were irrelevant there.
If those theories were right, then the undamaged Gauntlet could be caused by several things things:
1. They met with Thanos in the past/alternate reality, fought with him (again), and this time, succeed in getting the Infinity Gauntlet + Stones from him.
2. They gone to Thanos's crib, beat his ****, get the damaged gauntlet, and then repaired it.
3. They create another Infinity Gauntlet from the scratch.
Currently, we didn't know if Eitri survives the genocide, which is the only person left in the universe that can make/repair it. But if he also bites the dust, they can go to Microverse, and fixed/create a new one there.