private void removeFromListWithChanges(final @NotNull ShelvedChangeList listCopy,
                                         @NotNull List<ShelvedChange> shelvedChanges,
                                         @NotNull List<ShelvedBinaryFile> shelvedBinaryChanges,
                                         @NotNull CommitContext commitContext) {
    //listCopy should contain loaded changes
    removeBinaries(listCopy, shelvedBinaryChanges);
    removeChanges(listCopy, shelvedChanges);

    // create patch file based on filtered changes
    try {
      final List<FilePatch> patches = new ArrayList<>();
      List<TextFilePatch> filePatches = loadPatches(myProject, listCopy.getPath(), commitContext);
      for (ShelvedChange change : Objects.requireNonNull(listCopy.getChanges())) {
        patches.add(ContainerUtil.find(filePatches, patch -> change.getBeforePath().equals(patch.getBeforeName())));
      }
      writePatchesToFile(myProject, listCopy.getPath(), patches, commitContext);
    }
    catch (IOException | PatchSyntaxException e) {
      LOG.info(e);
      // left file as is
    }
  }
private void removeFromListWithChanges(final @NotNull ShelvedChangeList listCopy,
                                         @NotNull List<ShelvedChange> shelvedChanges,
                                         @NotNull List<ShelvedBinaryFile> shelvedBinaryChanges,
                                         @NotNull CommitContext commitContext)