git reset --hard HEAD~1 go one commit forward code example Example: git soft reset head git reset --soft HEAD^ //resets head by 1