How to restore MacOS Desktop Workspaces, Mouse, and Keyboard (etc.) settings?
I would suggest you open a finder window of your ~/Library/Preferences, click on "Date Modified", open System Preferences, make any change in relevant settings (mouse, workspace ...), watch and note down, which files get to the top of your file list.

These should be the ones that you should replace with the ones from a Time Machine backup, I'd presume ...