void (@NotNull Project project, @NotNull List<VirtualFile> gitRoots, @NotNull VirtualFile defaultRoot) { GitResetDialog d = new GitResetDialog(project, gitRoots, defaultRoot); if (!d.showAndGet()) { return; } new Task.Backgroundable(project, GitBundle.message("resetting.title"), true) { @Override public void run(@NotNull ProgressIndicator indicator) { try (AccessToken ignored = DvcsUtil.workingTreeChangeStarted(project, getActionName())) { GitCommandResult result = Git.getInstance().runCommand(d.handler()); if (!result.success()) { VcsNotifier.getInstance(project).notifyError(RESET_FAILED, GitBundle.message("resetting.title"), result.getErrorOutputAsHtmlString(), true); } GitRepositoryManager.getInstance(project).updateRepository(d.getGitRoot()); GitUtil.refreshVfsInRoot(d.getGitRoot()); } } }.queue(); }