@RequiresEdt
  private void removeAppliedAndSaveRemainedIfNeeded(@NotNull List<? extends FilePatch> remaining,
                                                    @NotNull Collection<PatchApplier> appliers,
                                                    @NotNull CommitContext commitContext) {
    ShelveChangesManager shelveChangesManager = ShelveChangesManager.getInstance(myProject);
    if (!shelveChangesManager.isRemoveFilesFromShelf()) {
      return;
    }

    try {
      List<FilePatch> patches = new ArrayList<>(remaining);
      for (PatchApplier applier : appliers) {
        patches.addAll(applier.getRemainingPatches());
      }
      List<ShelvedBinaryFile> binaries = ContainerUtil.mapNotNull(patches, patch -> {
        return patch instanceof ShelvedBinaryFilePatch ? ((ShelvedBinaryFilePatch)patch).getShelvedBinaryFile() : null;
      });
      shelveChangesManager.updateListAfterUnshelve(myCurrentShelveChangeList, patches, binaries, commitContext);
    }
    catch (Exception e) {
      LOG.error("Couldn't update and store remaining patches", e);
    }
  }
@RequiresEdt
  private void removeAppliedAndSaveRemainedIfNeeded(@NotNull List<? extends FilePatch> remaining,
                                                    @NotNull Collection<PatchApplier> appliers,
                                                    @NotNull CommitContext commitContext)