A corrupted database is returned to a correct state by rolling forward or backward through a change queue and applying changes to the database in a selective manner. Changes that did not cause the corruption are applied without modification when rolling forward or are skipped when rolling backward. Changes that caused corruption are addressed when rolling forward, such as by being ignored or modified and then applied. Changes that caused corruption are corrected when rolling backward.