'Why does wordpress replace my custom child-theme files with old versions of themselves?

It's like the system is messing with me deliberately. Twice this has happened now:

I make some edit to my own custom child-theme using the theme file editor in the wordpress admin interface, I hit save, and suddenly it has replaced the file with a copy of itself that is the state of a couple weeks ago.

The "last modified" date is the time I hit save but the content is not what I saved.

I'm completely out of ideas why this might happen. I do have backups but this can't keep happening...

EDIT: It might also be that it did the replacing over night and I didn't notice until I hit save (made a tiny adjustment), except the page displayed the correct version until I hit save. I am so confused.



Solution 1:[1]

Ok, so this was the problem:

I started my PC, Firefox reloads the last session. I had multiple instances of the page open (different tabs).

I would do work in Tab 1 and in the next session work in Tab 2. Tab 2 would load a cached version of itself from when it was last opened (before the work in Tab 1).

When I did not notice that, I would hit save and the old version would overload the last-saved one.

Oddly, reloading did not help. It would reload the cached version. I had to re-navigate to the page in a new tab.

Hope this will help someone someday.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vodis