How to access deleted files on someone else’s phone?

How to access deleted files on someone else’s phone? You must have come across situations when your phone accidentally wipes off all the data while updating a new version or by any other means....