For a file stored in OneDrive or a SharePoint Online library, you can go back to an earlier version of the file and restore it. Open the file you want to restore and go to File > Info. If the file has previous versions, you'll see a button named Version History. Select it to see the list of versions.