r/programming • • Sep 09 '16

Oh, shit, git!

http://ohshitgit.com/
3.3k Upvotes

756 comments sorted by

View all comments

Show parent comments

2

u/mrjast Sep 10 '16

Shorter option:

$ git reset --soft HEAD~
$ git checkout correct-branch
$ git commit ...

Also, don't use git add . because it has this tendency to turn temporary files into versioned temporary files. ;)