refactor reverting of file visiting buffers