git restore code example
Example 1: git soft reset head
git reset --soft HEAD^
//resets head by 1
Example 2: git clean
//Remove untracked files
git clean -f
//Remove untracked directories and files
git clean -fd
//Remove untracked ignored files
git clean -fX
//Remove all untracked files
git clean -fx
Example 3: git reset head
sudo git reset --hard Head