I think it would be helpfull if you could provide a few more details:
What hardware (Flight Controller)?
What connection PC- to FlightController are you using?
Which FW version were you on before?
Which FW version are you trying to install?
Which Software are you using to do the FW upgrade?
What do you mean with "all data lost"? You mean data on the SD card? You mean parameter settings?
Maybe, if you can give some more details it might be easier for people to try and help.