git reset file hard code example
Example 1: git soft reset head
git reset --soft HEAD^
//resets head by 1
Example 2: git reset one file
git checkout HEAD -- my-file.txt
Example 3: git file reset to head
git checkout HEAD -- my-file.txt
git reset --soft HEAD^
//resets head by 1
git checkout HEAD -- my-file.txt
git checkout HEAD -- my-file.txt