In project view there is an option to format files pointed by cursor. However, there is no confirmation dialog before action, so it is very easy to format all files of project with one click. Moreover, there is no information about what files has been formatted and no option for revert. So you can basically click on format files by accident and even don't notice all files has been formatted. My story is, that when I wanted to commit changes done in few files I have been very surprised that all files in project has changed. It is just my guess that I have accidentally clicked on format files while wanted to chose 'Find files'. Reproducible: Always Actual Results: Files formatted. No info about that. No option to undo. Expected Results: Confirmation dialog before action. Displayed status with info what files has been changed and possibility to do undo in some/all files. Until those dialogs are ready I would recommend to move that option from project context menu to some more safe place like Edit menu.
undo won't be implemented, use a VCS for that. a little dialog to warn the user about the action should be implemented though, agreed.
Thank you for agreeing on warn dialog. Unfortunately VCS cannot be always used easily to revert changes. In my case, formatting options caused some code to be eg. surrounded by {}. Such change cannot be easily filtered out by telling diff to ignore whitespace changes. So, I would opt for making an option for creating a diff (patch) before executing formatting, and then have an option to revert changes and apply the diff. However I understand this is quite complicated, and there are more important things to be changed prior to this.
*** This bug has been marked as a duplicate of bug 343895 ***