reset your commit in GitHub

Posted by

Here are some ways to reset your commit in GitHub:

  • If you haven’t pushed the commit yet:

Run the following command in your terminal:

git reset --soft HEAD~

This will undo the last commit and keep the changes in your working directory.You can then make a new commit with the correct changes.

  • If you’ve already pushed the commit:

You can use the git revert command to create a new commit that reverses the changes made in the original commit.
To do this, run the following command in your terminal:

git revert <e3222d33263dd7d35eafc920b710f9a931ec022a>
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x