void (@NotNull AnActionEvent e, @NotNull SingleCommitEditingData commitEditingData) { if (e.getPresentation().isEnabledAndVisible()) { // support undo only for the last commit in the branch if (commitEditingData.isHeadCommit()) { e.getPresentation().setEnabled(true); } else { e.getPresentation().setEnabled(false); e.getPresentation().setDescription(GitBundle.message("git.undo.action.description")); } } }