I want to implement feature to save changes in working directory before git reset --hard HEAD^
as detached head.
According to this question there are many people who lost their work.
So I offer next scenario for git reset --hard <sha>
:
1. `git add .`
2. `git commit -m 'Reset hard'`
3. `git reset --hard <sha>`
So if I need to restore lost working directory I will use git fsck --lost-found
Will it be useful to have next feature in git?
If it will what is the source file which is responsible for git reset
command?