Is there any way to implement 'Undo' for ScriptableObject assets?

I have trouble implementing ‘undo’ for a few of my config assets (ScriptableObject’s).

[CustomEditor(MyConfig)]
class MyConfigEditor (Editor):

config as MyConfig

def Awake():
    config = target as MyConfig

def OnInspectorGUI():
    if GUILayout.Button("Change config"):
        Undo.RegisterUndo(config, "Changed config")
        ... changing the config
        EditorUtility.SetDirty(config)

It seems like undo operations are reflected in the file system, but not in the inspector.

I was having the same issue but solved it using

Undo.RecordObject(config,"Changed config");