It's 2025 and Sublime Text 4 still has no option to disable history changes after closing the app. I sometimes hit undo (CTRL+Z) by mistake and don't know which was the last state of the file.
Luckily, I use Github and I can discard the changes of that file. Closing the file also helps, but is just tiring to close the files every time in a big project. Sublime 3 did not have this issue, as you mentioned above.