When working with files changed on disk, there are two warnings
- ... changed on disk; really edit the buffer?
- ... has changed since visited or saved. Save anyway?
They're useful, but get very impractical when switching branches fort and back (as I commonly do with git).
Is it possible to make Emacs determine that the content hasn't actually changed (or has been restored to a state equals to what's in its Emacs buffer)?
The fix given in the nearly-duplicate solves the first part only. As @Stefan wrote, the second is easy using (set-visited-file-modtime)
.