void () { saveAllDocuments(); Map<GitRepository, GitCommandResult> results = new HashMap<>(); try (AccessToken ignore = DvcsUtil.workingTreeChangeStarted(myProject, GitBundle.message(myPresentation.activityName))) { for (Map.Entry<GitRepository, Hash> entry : myCommits.entrySet()) { GitRepository repository = entry.getKey(); VirtualFile root = repository.getRoot(); String target = entry.getValue().asString(); GitLocalChangesWouldBeOverwrittenDetector detector = new GitLocalChangesWouldBeOverwrittenDetector(root, RESET); Hash startHash = getHead(repository); GitCommandResult result = myGit.reset(repository, myMode, target, detector); if (!result.success() && detector.wasMessageDetected()) { GitCommandResult smartResult = proposeSmartReset(detector, repository, target); if (smartResult != null) { result = smartResult; } } results.put(repository, result); updateAndRefreshChangedVfs(repository, startHash); VcsDirtyScopeManager.getInstance(myProject).dirDirtyRecursively(root); } } notifyResult(results); }