You should use git revert
(docs)
Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them.
You should use it to revert from HEAD to your specified commit with
git revert --no-commit <xxxxxxx>..HEAD
git commit
It is handy to use --no-commit, as stated in the docs, in case you have more commits to revert at once:
Usually the command automatically creates some commits with commit log messages stating which commits were reverted. This flag applies the changes necessary to revert the named commits to your working tree and the index, but does not make the commits. In addition, when this option is used, your index does not have to match the HEAD commit. The revert is done against the beginning state of your index.
This is useful when reverting more than one commits' effect to your index in a row.