-1
git status

On branch devel

Your branch is up to date with 'origin/devel'.

Changes not staged for commit:

(use "git add <file>..." to update what will be committed)

(use "git checkout -- <file>..." to discard changes in working directory)

      modified:   DigitalExperience/Excels/names/customer(New)

no changes added to commit (use "git add" and/or "git commit -a")

How I can completely discard this change

tense
  • 1
  • 1
  • 5
    Does this answer your question? [How do I discard unstaged changes in Git?](https://stackoverflow.com/questions/52704/how-do-i-discard-unstaged-changes-in-git) – Brian61354270 Mar 18 '20 at 23:41

1 Answers1

0

The answer is in the text you quoted, except for one possible stumbling block:

(use "git checkout -- <file>..." to discard changes in working directory)

Hence:

git checkout -- "DigitalExperience/Excels/names/customer(New)"

is likely to do the trick. You may need some other kind of quote marks (single quotes), or no quote marks at all, depending on your command-line interpreter.

The problem here is that the file's name includes parentheses. This file is named:

DigitalExperience/Excels/names/customer(New)

complete with opening and closing parentheses, and some command-line interpreters treat those specially.

torek
  • 448,244
  • 59
  • 642
  • 775
  • I used > git checkout -- "DigitalExperience/Excels/names/customer(New)" But its does not delete the chngeses – tense Mar 19 '20 at 00:01
  • In that case: (1) Are you on a case-insensitive file system such as the default Windows or MacOS file system? (2) If so, is there another file in the commit with a name that differs only in case, probably created on a Linux system? (3) Are you using `.gitattributes` and/or `core.autocrlf` to change line endings in the work-tree? (4) What version of Git are you using? – torek Mar 19 '20 at 06:09