git reset --keep HEAD@{1} code example Example: git soft reset head git reset --soft HEAD^ //resets head by 1