What does formatting change in the data?
In many cases, yes, but the outcome depends mainly on the storage-device type, the formatting method, and whether anything was written after the event. With quick formatting, the system usually removes file-structure information, while the data itself may remain on the storage device until it is overwritten.
Recovery is rarely a simple “undo” operation. First we need to confirm whether the issue is purely logical or whether formatting exposed an unstable device.