Actually there is a way. But it depends on how often you saved and the no. Of backup you put in the settings. Cause you can transfer pokemon from one save file to another with the help of shared box. Just see if there is a save file before you entered agate circus. If there is then equip a.pokemon with the fossil and put it in the shared box, save and then use the old save file. Then you can go to the museum and revuve the fossils and put them in the shared box and save. Then use the save file where you advanced the furthest and you have the pokemon in the shared box.