Explain how? I've yet to find something reliable like this. At best you can have a decent number of apps automatically reinstalled to the original state, but not all, and most settings don't transfer, etc. And that requires root access, which most people don't have afaik.
You can declaratively manage your phone with something like github.com/devindudeman/nix-android so you'd point at a decoy config file and rebuild before crossing the border and then point at the up-to-no-good config file once across.
Of course you do have to be able to reference those files somehow, so they have to be online, but if there are no references to them on the device then the border folks would have to somehow know about them and be able to access them in order to link you and your device to the declared configs. There are a lot of ways to hide such a thing.
Presumably the most sensitive thing here is your social graph and messages. I haven't verified if nix-android handles them in a way that would make sense here, but it's at least plausible that it might.
I used to do this kind of thing with TiBackup when Android phones were easy to play with and experimentation was more common.
I'd back up the phone to an SD card and/or send the backup offsite over the network.
After that, I could nuke whatever I wanted -- or factory reset it, switch to a different OS (we often called them "ROMs" back then), play with that for a bit, switch back and forth, or whatever.
When the time was right, I'd use TiBackup to restore the backup. It didn't even have to be the same phone. Apps and data were restored to where they had been. Home screens looked the same. Settings and preferences went back to how they were. The same web stuff remained in browser cache, alongside the same cookies.
There were occasional outliers that didn't come back perfectly, of course, but broadly speaking: It worked very well. Those outliers were few and easy to deal with.
This required root access. But for a time (years), that was easy.
(I will never accept any defense of any proclamations that we must be restricted from doing whatever the fuck we want with the hardware that we own. If I can do things with a desktop PC, then I should also be able to do those same things with a pocket computer.)