Git: Undo commit

Sometimes, when the caffeine no longer works, you can make a mistake on a commit. Either you have second thoughts about your commit message, you just forgot to track new project files, or whatever the reasons are you can always undo your last commit (as long you don’t push it to origin repository):

$ git reset --soft HEAD^
Advertisements
Git: Undo commit

Leave a Reply

Please log in using one of these methods to post your comment:

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