The firmware does not really get the last data stored in the cloud. Rather, the cloud always has the last data reported by the device. For parameters like "Name", the PROP_FLAG_PERSIST flag is provided while creating the parameter as you can see
here. This ensures that the value is stored in persistent memory and is retrieved on a reboot. Your registered device write callback gets invoked automatically when you add such a param to the device and a value for that is found in persistent memory.
Alternatively, if you want to be able to send some commands to the device even when it is offline and expect it to receive them when it comes online, you can use the
command response framework.