How to recover my changes that I accidentally saved as .geojson

In JOSM, I accidentally saved my changes as a .geojson file instead of .jos. When I open this and try to upload it to OSM, it creates duplicates for every object in the file.

How can I recover my work?

I found a suitable copy of my work in .local/JOSM/autosaves.