How to recover files lost after reinstalling Ubuntu?

It has been said that the files would be safe if I reinstalled and used the same username and password.

Whoever said that lied to you. Unless you had /home on a separate partition, and in the new install chose to not format that partition, your files are unrecoverably gone. And even if /home was separate, if it was encrypted I hope you backed up the encryption key. Otherwise the files are still gone.