By mistake I ran git checkout --
and all local changes are gone. I can't see anything when running git log
. How can I get all local changes back?
Asked
Active
Viewed 401 times
0

Rylan Polster
- 321
- 3
- 14

murtza gondal
- 997
- 2
- 12
- 26
-
1Possible duplicate of [Get back the changes after accidental checkout?](https://stackoverflow.com/questions/2961240/get-back-the-changes-after-accidental-checkout) – phd Feb 11 '19 at 18:47
1 Answers
1
From what I’m aware of, calling git checkout — <file>
will permanently discard local changes on that file, meaning you won’t be able to retrieve it.
However, if your work may be on a separate IDE or tool it may have revision histories so you could possible retrieve it from there, however I’m unsure if it’s possible still.
Git has a dedicated page to this question: how to undo changes with GIT

Wais Shahbaz
- 19
- 4