Everything worked fine unit today.
Symantec/Antivir scanned and restarted my computer and afterwards my workspace looked like this.
Does anyone know what I can do?
How can I set the HEAD once a again?
In local the paths are all removed.
Everything worked fine unit today.
Symantec/Antivir scanned and restarted my computer and afterwards my workspace looked like this.
Does anyone know what I can do?
How can I set the HEAD once a again?
In local the paths are all removed.
You can always clone the project again to get the latest code from the repository.
Another option is to execute fsck
and recover from dangling files.
# Search for all uncommitted added files = dangling content
git fsck --full
# print out the content of the dangling content
git show <SHA-1>
If the content is commited simply use git reflog
More info in more detailed can be found here:
How to move HEAD back to a previous location? (Detached head)
A single line command, breached into multiple lines only for readability
# You can try recovering a branch by resting your branch to the sha
# of the commit found using a command like:
git fsck --full --no-reflogs --unreachable --lost-found |
grep commit | cut -d\ -f3 | xargs -n 1
git log -n 1 --pretty=oneline > .git/lost-found.txt
# Display the above commits
git log -p <commit>
# OR:
git cat-file -p <commit>