RomanV wrote:Is there a way to restore RPi to it's 'default' state without formatting SD-card?
Maybe some kind of a script that will uninstall all the packages and remove user data?
What are you *really* trying to do?
The Raspberry Pi hardware itself has no storage of its own: once the SD card is removed it is in pretty much the same default state as it was when it left the factory.
One way to restore your RPi's Operating System to its default state is to re-flash an image of an Operating System (such as Raspbian) to another SD card. Neither the original nor new SD card needs to be formatted.
Another interpretation might be to use the NOOBS Installer. Initially, this requires the SD card to be appropriately formatted to get the Installer running in the first place. But once you have done that, you can re-install the 'factory-fresh' version of the Operating System as many times as you wish without ever having to re-format the SD card.