Earth could have lost anywhere between ten and 60 per cent of its atmosphere in the collision that is thought to have formed the Moon.
New research led by Durham University, UK, shows how the extent of atmospheric loss depends upon the type of giant impact with the Earth.
Researchers ran more than 300 supercomputer simulations to study the consequences that different huge collisions have on rocky planets with thin atmospheres.
Their findings have led to the development of a new way to predict the atmospheric loss from any collision across a wide range of rocky planet impacts that could be used by scientists who are investigating the Moon's origins or other giant impacts.
They also found that slow giant impacts between young planets and massive objects could add significant atmosphere to a planet if the impactor also has a lot of atmosphere.
The findings are published in the Astrophysical Journal Letters.
The Moon is believed to have formed about 4.5 billion years ago following a collision between the early Earth and a giant impactor possibly the size of Mars.
Research lead author Dr Jacob Kegerreis, in the Institute for Computational Cosmology, Durham University, said: "The puzzle about how the Moon formed and the other consequences of a giant collision with the early Earth is something that scientists are working hard to unravel.
"We ran hundreds of different scenarios for many different colliding planets, showing the varying impacts and effects on a planet's atmosphere depending upon a number of factors such as the angle, speed of impact or the sizes of the planets.
"While these computer simulations don't directly tell us how the Moon came to be, the effects on the Earth's atmosphere could be used to narrow down the different ways it might have been formed and lead us closer to understanding the origin of our nearest celestial neighbour."
Earlier this year, an initial study by Durham University reported that giant impacts which dominate the late stages of planet formation can have a wide range of consequences for young planets and their atmospheres.
That study examined the ways that thin atmospheres could be removed by objects impacting at different angles and speeds.
The researchers' latest paper looks at the effects across a much wider variety of impacts adjusting for size, mass, speed and angle of the impacting object. They also changed the density of the impactor and if it was made of iron, rock or both.
The simulations revealed the different outcomes when one or more of these variables are changed, leading to atmospheric loss or gain, or sometimes the complete obliteration of the impacted planet.
The research team also included scientists at the BAERI/NASA Ames Research Centre and the University of Washington, USA, and the University of Glasgow, UK.
Co-author Dr Luis Teodoro, in the School of Physics and Astronomy, University of Glasgow, and the BAERI/NASA Ames Research Centre, said: "This major suite of planetary simulations also sheds light on the role of impacts in the evolution earth like exoplanets."
The high-resolution simulations were run using the SWIFT open-source simulation code. They were carried out on the COSMA supercomputer, part of the DiRAC High-Performance Computing facility in Durham, funded by the Science and Technology Facilities Council (STFC).
The research was funded by the STFC, NASA and The Royal Society.