DEV Community

Discussion on: Git Explained: The Basics

Collapse
 
milu_franz profile image
Milu

Thank you for taking the time to read this post, Fabio! Glad it helped you understand branches.
To answer your question, you can use: "git revert HEAD" to reverse to your last commit. It is important to point out that git won't delete the reversed commit, instead, it will add a new commit that undoes the changes you added in your last commit. This is a super safe way to go back in time because you are keeping all your code in history! I can provide more details about git revert in a future post.