An exoplanet the size of Earth may have lost its original atmosphere, but acquired a second one due to volcanism