Undo unexpected replacements and additions due to merge