If your changes have already been pushed to a public, shared remote, and you want to revert all commits between HEAD
and <sha-id>
, then you can pass a commit range to git revert
,
git revert 56e05f..HEAD
and it will revert all commits between 56e05f
and HEAD
(excluding the start point of the range, 56e05f
).