The Lazarus Project
(2008)

Ben Garvey (Paul Walker) is sentenced to die by lethal injection for being an acessory to murder, only to wake up in Oregon as a groundskeeper for a mental institution.  Alternately guided by a priest Erza (Bob Gunton) and haunted by an man Avery (Lambert Wilson) who claims he can never leave, Ben slowly unravels and finds out he is actually a patient.  Over time, he comes to believe his family is dead (by his own negilence) and comes to terms with his new life.
 
Only it is all a lie.  Ben uncovers evidence of him being there before the hospital told him he was a patient. In actuality, Ben has been chosen for what is known as the Lazurus Project.  The project entails taking men like Ben and stripping away their previous lives through forceful means and giving them new ones. This is used as a means for proactive rehabilation and an alternative to executions.  However, as Ben's case proves, the premise is flawed as one can never let go of their core identity.
 
Ben confronts Avery (who is actually a researcher of the project) and Erza and tells them they didn't help anyone; all they're really doing is torturing people. He tells them he is going home and If they stop him, he will make sure the project will leaked to the news as he copied the files and sent them to his wife (and this is implied how he will retain his freedom as he should technically been executed).  Ben goes to Lisa's (Piper Perabo) new home and she tearfully embraces him.    

Thanks Spectre!