How to undo the latest git commit

We wrote some time ago about how to undo the latest changes without using git stash

But today I will give a quick line to “cancel” the latest commit that you did:

git reset --soft HEAD^

This will keep the changes you did.

Thanks to Andrew: http://stackoverflow.com/questions/927358/how-to-undo-the-last-git-commit

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s