Is there any way to reset the uci config to default


Say I am changing some config via uci commands and committing that. How we can reset this change in uci sub system config.

For e.g
uci get system.@system[0].hostname

uci set system.@system[0].hostname=openwrt22
uci commit system
uci get system.@system[0].hostname


Now I want to revert it. is there any command to revert this or revert whole system subsystem to default.

There is no "revert" in UCI. In an overlayfs environment, you can nuke all changes to system config with rm /overlay/upper/etc/config/system. This will cause the default file in ROM to replace the modified file.

This does not work in an ext4 filesystem because there is only one copy of the file, the one that has been changed.