Is there a way to make Notepad++ to ask for confirmation when replacing all instances of a string in a file or files?
This is to prevent inadvertent replacement.
Not that I know of. If you're modifying a single file, I don't think it's needed.
Clicking Replace All always displays a dialog showing how many occurrences were replaced. To revert the changes, just give focus to the text window and Ctrl + Z to undo the last operation.