That’s really not how anything works. You do not “recreate” a schema: a schema is a description of the data you consider valid.
The schema specifies the type of the values, and optionally even ranges, so the storage cannot contain something that isn’t at least valid.
Applications can reset a key to its default value, but that default must exist in the schema; resetting a key is an action you make to roll back the existing setting—an explicit “reset to default” control in your UI.
It seems you’re overthinking this a lot. All you need, when using GSettings, is:
- provide a schema
- install the schema (and call
glib-compile-schemasas part of that operation) - create a GSettings instance for that schema
- read settings when building the UI, write them when the user changes something
- connect to the
changedsignal to know if a setting has changed, and reflect that change in your UI
That’s it.