Restore the original working directory prior to saving the file