The issue here is that the name of the file contains Unicode sequences, representing non-ASCII characters in the file name:
$ printf '%b\n' '03.08 T&D \347\224\260\346\235\260 WeeklyReport.md'
03.08 T&D 田杰 WeeklyReport.md
When git status
prints the file name, it's not sure if it is OK to produce Chinese script on your screen, so it writes out the octal values of the UTF-8 sequence that would have produced 田 and 杰, rather than printing them. [Edit: if you set core.quotePath
to false
, that tells Git that it is OK to print such characters without replacing them with escape sequences. See below.]
The above printf
command shows one way to express the file name in a way that allows you to cut and paste it. You could then use:
git checkout -- '03.08 T&D 田杰 WeeklyReport.md'
to get it back.
What about git stash
?
The method you used—running git stash
—amounts to making a commit from the change that you had staged, then running git reset --hard
. The commit that git stash
made is not on any branch. Running git stash list
will show the commit that git stash
made. You can do whatever you want with this later.
Technically, git stash
actually made two commits that are on no branch, but in this case only one of them did anything useful: it saved the deletion of the file, in case you really did mean to delete it. That's not very hard to reproduce (you can just delete the file again), so you can simply drop the stash:
git stash drop
as long as there is nothing else of value in it.
Using core.quotePath
Again, I don't have your repository here, so I had to just make my own guesses about files. Here's what I did:
$ mkdir tmp/tpath; cd tmp/tpath; git init
Initialized empty Git repository in .../tmp/tpath/.git/
$ echo text > '03.08 T&D 田杰 WeeklyReport.md'
$ git add .
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: "03.08 T&D \347\224\260\346\235\260 WeeklyReport.md"
$ git config core.quotePath false
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: 03.08 T&D 田杰 WeeklyReport.md
$ git commit -m initial
[master (root-commit) 5658907] initial
1 file changed, 1 insertion(+)
create mode 100644 03.08 T&D 田杰 WeeklyReport.md
If you're on Windows or MacOS, be aware that some UTF-8 file names can run into various translation issues, in ways similar to cases where a Linux user can create two different files named readme
and README
and commit them. If you never move from your Windows or MacOS system to Linux and vice versa, you won't run into problems, but if you do, you may. (This is more commonly a problem with accented characters in file names like agréable
or schön
. Unicode has multiple ways to spell these names, but MacOS in particular insists on spelling them its way.)