Skip to content

Instantly share code, notes, and snippets.

@phil294
Last active January 2, 2021 14:35
Show Gist options
  • Save phil294/7b8327fb545126cb73e203d82e1d3b98 to your computer and use it in GitHub Desktop.
Save phil294/7b8327fb545126cb73e203d82e1d3b98 to your computer and use it in GitHub Desktop.
Undo/reverse an accidental "Forget about this site" click in Firefox history

If you have a backup of the old places.sqlite file (of the old Firefox profile folder), you can simply replace the new one with the old one or you can do the following. Meant for MacOS/Linux systems, on Windows you'd probably also need to install sqlite.

Close Firefox and copy the new places.sqlite and the old places.sqlite, renamed as old.sqlite, into a folder.

sqlite3 old.sqlite

You need to adjust the-site-to-restore.com to your needs below.

attach "places.sqlite" as new;
insert or ignore into new.moz_places select * from main.moz_places where url like "%the-site-to-restore.com/%";
insert or ignore into new.moz_historyvisits select * from main.moz_historyvisits where place_id in (select id from main.moz_places where url like "%the-site-to-restore.com/%");

places.sqlite now also contains the history visits to the-site-to-restore.com from old.sqlite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment