message: read the content of the new file and apply the changes there
  The blob does not contain the new file without adding manually to the index. Instead of adding the file to the index, we load the current file, change it and save it again
diff: @@ -523,6 +523,13 @@ void FileWidget::discardHunk() {
  }
  QString name = mPatch.name();
  + QFile dev(repo.workdir().filePath(name));
  + if (!dev.open(QFile::ReadOnly))
  + return;
  +
  + QByteArray fileContent = dev.readAll();
  + dev.close();
  +
  QSaveFile file(repo.workdir().filePath(name));
  if (!file.open(QFile::WriteOnly))
  return;
  @@ -530,9 +537,11 @@ void FileWidget::discardHunk() {
  QByteArray buffer;
  for (int i = 0; i < mHunks.size(); ++i) {
  +
  + QByteArray hunk_content;
  if (mHunks[i] == hunk) {
  - QByteArray hunk_content = hunk->hunk();
  - buffer = mPatch.apply(i, hunk_content);
  + hunk_content = mHunks[i]->hunk();
  + buffer = mPatch.apply(i, hunk_content, fileContent);
  }
  }
  