I just did:
git checkout -- .
without realizing that there were important, non-committed changes. I have not touched the repo since making that mistake.
Is there any way of "undoing" that command, or have I lost the uncommitted work?
I just did:
git checkout -- .
without realizing that there were important, non-committed changes. I have not touched the repo since making that mistake.
Is there any way of "undoing" that command, or have I lost the uncommitted work?
You can revert git checkout
if and only if you have done one of these two:
git stash
to record the previous state of the working directory (before git checkout
). You can revert git checkout
by using git stash apply
or git stash drop
Otherwise, unfortunately there is no way to revert uncommitted changes removed by git checkout
.
This is same as git checkout .
If you haven't stored the changes anywhere they are as good as lost.
If you are using an editor like IntelliJ, there's an option to view local history where you can find your changes