Some say that it was not Sita who entered the fire, but Maya-Sita, a double of Sita. Ravana never actually brought Sita to Lanka. Instead, the devas snatched Sita from Ravana's chariot when he wasn't looking, replacing the real Sita with Maya, an illusion.
Ravana took Sita's double to Lanka, and it was Sita's double who came to Rama on the battlefield at the end of the war.
When she stepped into the fire, the Maya-Sita was destroyed, and Agni restored the real Sita to Rama.
So it was Maya-Sita who entered the fire, but the real Sita who emerged.
Inspired by: Sita: An Illustrated Retelling of the Ramayana by Devdutt Pattanaik. Notes: This story is on p. 252 of the book. For more about the Maya-Sita, see Wikipedia. Pattanaik notes that this legend is found in the Adbhut Ramayana and in the Malayalam Ramayana. Compare the Greek legend about a double of Helen taken by Paris to Troy, as in Euripides' play, Helen.