Yes, but it's usually not recommended, especially if you have already pushed your changes up to GitHub.
Instead of actually removing a commit, you usually "revert" a commit. The "git revert" command actually produces a new commit which performs the actions necessary to undo the earlier commit. This way, you have a record that the mistaken change was made earlier, and that it was then corrected, instead of just rewinding into the past.
This approach is usually safer, because it means that if you later realized that there was something useful in that mistake commit after all, you could still go back and look at it.
For more detail, see: https://www.theserverside.com/tutorial/How-to-git-revert-a-commit-A-simple-undo-changes-example