The New Magdalen, by Wilkie Collins

Grace and Mercy are very different women, but are both caught up in the war between Germany and France. When Grace is hit by a loose shell, Mercy seizes the chance to escape her past as a fallen woman and convict by assuming Grace’s identity and travelling to England.