first discard the file, then call fileRemoved which causes the unselectCurrentFile to resave the file.