You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually we would use git status to check what files have changed
git status
Outputs:
On branch master
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
modified: README.md
Untracked files:
(use "git add ..." to include in what will be committed)
another-file
my-new-file
Using the flags -sb we can shorten the output
git status -sb
Outputs:
master
M README.md
?? another-file
?? my-new-file
See the reference log of your activity
git reflog --all
Look at the HEAD at given point from reflog
git show HEAD@{2}
Checkout the HEAD, to get back to that point
git checkout HEAD@{2}
This will find any change that was staged but is not attached to the git tree
git fsck --lost-found
See the dates of the files
ls -lah .git/lost-found/other/
Copy the relevant files to where you want them, for example: