How to revert a Git commit
Locally, if you do not have pushed your local remote to any remote Git repository:
or just add the --ammed flag
Remotely, if you already pushed your commit to a remote Git repository:
git reset --hard <revision_id_of_the_commit_you_would_like_to_reset_to>
or just add the --ammed flag
git commit --amend -m "This commit will add additional/changed content to your previous local commit"
Remotely, if you already pushed your commit to a remote Git repository:
git reset --hard <revision ID of a commit you would like to overwrite the HEAD commit of a GIT repository>git push -f
Comments
Post a Comment