Here the step on how we can reset my last X commits together using git reset

we can do this fairly easily withgit reset

1-Using git reset I will reset my last x commit I done locally to my branch this will undo my x commit from my local repo

git reset --soft HEAD~x