Skip to content

Undo unpushed commits

Imagine you have just committed your changes and are ready to push them, as you noticed that you forgot to omit some confidential data. Fortunately, there is a way to undo this with the following command:

git reset HEAD~

Now, you have a "dirty" work directory again. From there, you can perform your changes.


Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.