Final answer:
To rollback a git commit after push, use 'git revert' with the commit hash to create a revert commit and push it, or 'git reset' and a forced push to remove the commit from history, which should be done cautiously.
Step-by-step explanation:
To rollback a git commit after a push, you need to revert the changes made by the last commit. This can be done by creating a new commit that undoes the changes. First, find the commit hash for the commit to revert using git log. Then use git revert followed by the commit hash.
This will create a new commit on top of the current history. However, since the commit has already been pushed, you will have to push the revert commit as well.If you want to completely remove the commit from the history, use git reset to move back to the previous commit and then perform a git push --force.
Be aware that rewriting history can cause issues for others if they have pulled the old commit, so it should be done with caution. Communicate with your team before doing a forced push.