Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

If I commit to a branch but I realize I don't want that commit anymore, can I erase it?

Once I finish the Intro to GitHub course, I will start using GitHub in my daily workflow.  What happens if I don't want the commit anymore? 

1 Reply
Highlighted
Moderator
Message 2 of 2

Re: If I commit to a branch but I realize I don't want that commit anymore, can I erase it?

This is a great question! Git provides a helpful command called "git reset" that allows you to remove changes that were committed into history back to the early stages of work. There are several options when using "git reset" so depending on which option of reset you choose will give you a different outcome. This Git command can be destructive so be cautious when using it. 

 

Here is a helpful videoblog post, and oneline book to help you get started learning more.