Document automatic recovery