Undo last commit
This is pretty helpful, I often find myself working on different branches and merging pull requests of other members of my team.
So sometimes I have unstashed changes, and I need to rebase changes on other branch...
So I commit those changes go to the other branch, do the rebase and push and so on... and then later when I need to go back to what I was working I just undo the last commit, or --amend the new changes.
git reset --soft HEAD~That will undo the last commit, but you won't lose the changes.
Written by Miguel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
 #Undo 
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#

 
 
 
 
