revert and delete and write