Full reset system.

Ability to full reset your system to basic install would be nice.

Just reflash the uSD card?

No, from in the running system is what would be nice.

It’s totally unnecessary. Just reflash your SD card like it was suggested. Ability to have the entire system wiped is not a good idea even from a security standpoint. Someone could gain access to your system and wipe everything on it whilst setting it up for their own use (i.e. as part of a botnet).

I’d bet my life they won’t add this ever. No one has.

You could run the DietPi-PREP script:

bash -c "$(curl -sSL https://raw.githubusercontent.com/MichaIng/DietPi/master/PREP_SYSTEM_FOR_DIETPI.sh)"

At least regarding DietPi scripts/configs and APT packages it resets the system somehow. But many manually installed files will stay in place, e.g. things in /opt/ or /usr/local/, all that was installed as source build or generally outside of APT packages.
So at least it would be recommended to uninstall all software via dietpi-software first.

Taking into account that there will always be remains, I agree with ghettopi that one should simply re-flash the SDcard as a much cleaner approach, if you really want a 100% reset.

Script came in handy, did some test with a failing ssd and my users data was on that failing ssd.
but it was an experiment, only for testing, so i could not change the users_data to an other disk and i have a image yes of my system but with your script it was handy to fix it quicker.

Used your script, but did get an D-BUS error, the trick was to delete packages with apt autoremove to fix it, then the installation worked.

I still think a simple secure tool to reset te system would be a nice option, but the script worked fine after some tinkering.

Thx for your solution.