I changed files on a branch
, let's call it foo
, and then added them to track:
git add folder/
However, I forgot to commit
and forced checkout to another branch.
Is there any way to get those uncommited
changes on foo
branch back?
I changed files on a branch
, let's call it foo
, and then added them to track:
git add folder/
However, I forgot to commit
and forced checkout to another branch.
Is there any way to get those uncommited
changes on foo
branch back?
No.
By forcing checkout, you destroyed your changes.
In general, --force
or --hard
in git means that you're destroying something.
Instead, you should have git stash
ed first.