Game not saving from time to time.

I’ve been playing on a Minecraft world quite a bit, Whenever I mine out a bit of terrain, leave the world, and go back in the progress I just made is undone. For example.

Or whenever I plant a bunch of crops and leave, a lot of them are not there when I return.

Any solutions? It’s not that bad seeing as it only sets me back a little bit, but it is still annoying.