If the resources you have collected disappeared or if your upgrade hasn’t gone through, then it might be that you have experienced a small rollback.

This kind of rollback happens when your connection drops for some seconds and the game hasn’t yet saved your last actions. So when you get back into the game, you start from the state before your last actions were done. But don’t worry - this means that resources you have used during that time aren't lost.

You can prevent this “rollback” by tapping on the “Guild” tab before closing your game. It will force the game to connect to the server in order to load the guild information, and therefore save your progress!
Note: Sometimes, you can experience a rollback if you open the game after it was minimized for a long time.