Suppose a man commits murder and is then promptly involved in a car crash that leads to complete loss of all his memories prior to the car crash. The police have indisputable proof that the man did indeed commit the murder. Should they prosecute? If you conclude that they should because in some sense he's physically the same person what if a murderer somehow makes a copy of themselves and then commits suicide, should the copy be prosecuted? If you conclude that they shouldn't be prosecuted because the person after the accident is a different person from before the accident what if there's indisputable evidence that all of their memories will return in 5 years? 5 weeks? 5 days?
To my mind the person after the accident is a different person from the one who committed the murder and should therefore not be prosecuted. If the memories return then they should be prosecuted but we shouldn't punish them for a crime "they" didn't commit. But I am unsure as to how much of their memories need to return before they again become liable for their past actions.