I'm not stupid: I know that the guards kill me when I commit crimes, but I don't know how to stop it. I saved before I stole the stuff, then I got caught stealing it and accidentally deleted my save. :( 

Now all the guards in Riften attack me on sight, so I can't even go to jail or anything. My last save before the one I delete is like 4 hours of gameplay behind where I am now, and I really don't want to have to revert. How can I fix this problem?