Quote:
Originally Posted by suzzer99
Yep. just reversed commit. But those changes I committed are lost in the wind. Luckily I have sublime open and can just hit Ctrl-Z to get back to where I was. I found this but it seems painful: http://stackoverflow.com/questions/9...commits-in-git
Once cool think I just found is you can go back to previous commits in Sourcetree and reverse hunks or lines. In that way I was able to get back one of the files I un-committed, which wasn't open in Sublime.
`git reflog` shows changes to your index (there's probably a more technical way of putting it, I'm not quite a git master) along with the commit hashes. So if you wanted to get back to a previous state after an "oh ****" moment (in this case, losing files you accidentally added then reverted), that would show you the hash of the commit you reverted to so you could check that out again.
Personally, I think using git in a command line is vastly superior to any GUIs. For one, everything you do is logged right there in the terminal window so it's trivially easy to reset to a previous state when all state changes you've made are documented as you commit them.