void (final Project project, final Set<? extends VirtualFile> modifiedWithoutEditing) { final String operationName = StringUtil.decapitalize(removeMnemonic(getRollbackOperationName(project))); String message = (modifiedWithoutEditing.size() == 1) ? VcsBundle.message("rollback.modified.without.editing.confirm.single", operationName, modifiedWithoutEditing.iterator().next().getPresentableUrl()) : VcsBundle.message("rollback.modified.without.editing.confirm.multiple", operationName, modifiedWithoutEditing.size()); int rc = showYesNoDialog(project, message, VcsBundle.message("changes.action.rollback.title", operationName), getQuestionIcon()); if (rc != Messages.YES) { return; } final List<VcsException> exceptions = new ArrayList<>(); final ProgressManager progressManager = ProgressManager.getInstance(); final Runnable action = () -> { final ProgressIndicator indicator = progressManager.getProgressIndicator(); try { ChangesUtil.processVirtualFilesByVcs(project, modifiedWithoutEditing, (vcs, items) -> { final RollbackEnvironment rollbackEnvironment = vcs.getRollbackEnvironment(); if (rollbackEnvironment != null) { if (indicator != null) { indicator.setText(VcsBundle.message("progress.text.performing", vcs.getDisplayName(), StringUtil.toLowerCase(removeMnemonic(rollbackEnvironment.getRollbackOperationName())))); indicator.setIndeterminate(false); } rollbackEnvironment .rollbackModifiedWithoutCheckout(items, exceptions, new RollbackProgressModifier(items.size(), indicator)); if (indicator != null) { indicator.setText2(""); } } }); } catch (ProcessCanceledException e) { // for files refresh } if (!exceptions.isEmpty()) { AbstractVcsHelper.getInstance(project).showErrors(exceptions, VcsBundle.message("rollback.modified.without.checkout.error.tab", operationName)); } VfsUtil.markDirty(true, false, VfsUtilCore.toVirtualFileArray(modifiedWithoutEditing)); VirtualFileManager.getInstance().asyncRefresh(() -> { for (VirtualFile virtualFile : modifiedWithoutEditing) { VcsDirtyScopeManager.getInstance(project).fileDirty(virtualFile); } }); }; progressManager.runProcessWithProgressSynchronously(action, operationName, true, project); }