Commit #407
Commit
#407
-
How do you revert a commit in Git? |
Beta Was this translation helpful? Give feedback.
Answered by
rohit32999
Oct 18, 2024
Replies: 1 comment
-
You can revert a commit by using the command git revert <commit_hash>. This creates a new commit that undoes the changes made by the specified commit. If you want to remove the commit from history, you can use git reset <commit_hash>, but be cautious as this can alter the commit history. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rooo02
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can revert a commit by using the command git revert <commit_hash>. This creates a new commit that undoes the changes made by the specified commit. If you want to remove the commit from history, you can use git reset <commit_hash>, but be cautious as this can alter the commit history.