You can't undo a git restore with git. The documentation tells you in the Important section that it's a dangerous command.
It’s important to understand that git restore is a dangerous command. Any local changes you made to that file are gone — Git just replaced that file with the last staged or committed version. Don’t ever use this command unless you absolutely know that you don’t want those unsaved local changes.
Git recommends to either stash / branch your changes if you are unsure what to do with them currently, but still need to move to another branch or pull or etc.
Edit: this applies for the git checkout -- <...> approach as well. Same warning and dangers.
Possible solution: If you text editor is still opened with the file you have restored, then you can undo (through whatever undo command your editor supports, maybe Ctrl+Z) to get back your changes. That is - if you are lucky to have your important changes saved into memory by your editor.