I don't recall how my git local repo got into this state, but here is the situation:
My status on the command line says "nothing to commit, working tree clean".
git stash show -p stash@{0}
shows a diff of some changes, and as I casually scroll through (not really understanding how the language of git works), I see the specific words that I remember writing within certain functions, so I feel encouraged because I know that my work isn't lost.
But when I run git stash apply stash@{0}
I see:
CONFLICT (rename/delete): datastore/static/js/app/main.js deleted in Stashed changes and renamed to assets/js/app/helpers/main.js in Updated upstream. Version Updated upstream of assets/js/app/helpers/main.js left in tree.
CONFLICT (rename/delete): datastore/static/js/app/filters.js deleted in Stashed changes and renamed to assets/js/app/helpers/filters.js in Updated upstream. Version Updated upstream of assets/js/app/helpers/filters.js left in tree.
And git status
shows:
Unmerged paths:
(use "git restore --staged <file>..." to unstage)
(use "git add <file>..." to mark resolution)
added by us: assets/js/app/helpers/filters.js
added by us: assets/js/app/helpers/main.js
I tried running git add .
, but then my files didn't contain the changes that existed in the stash.
So then I reset the situation (got back to "nothing to commit, working tree clean"), ran git stash apply stash@{0}
, and then this time ran git restore --staged assets/js/app/helpers/*
, and the result doesn't seem any different to me (compared to when I ran git add .
).
In both cases, when I inspect my files, certain key words are missing that exist in the stash.
How can I recover my work?