jspseudo on how to restore a file safely

ready to turn into js