unregister_setting() vs delete_option() for plugin update

register_setting() / unregister_setting() are used to let WordPress know that it should allow / remove a given setting name—to set up the “allowed options” list, etc. You’re telling WordPress that the setting my_name will exist, and that it is allowed to be used by the Settings API.

add_option() / delete_option() actually do the work of adding / removing the value of the my_name setting (or option) from the database.

If you’ve changed the way your plugin sets up its data, you might need to use delete_option() to remove the data that’s already been stored. However, if you’re registering different settings, you shouldn’t need to use unregister_setting() on the old ones, since the allowed settings list isn’t stored in the database.