Hello,
Usually formatting the disk will erase all contents on it. You need to deploy data recovery software to get the data back.
If the drive is not recognized on Windows, it may be formatted with Mac's file system. I recommend you to follow this guide and format it with Windows supported file system to get it recognized:
https://support.apple.com/en-in/guide/disk-utility/dskutl1010/mac
Hope this helps!