3 points | by below43 12 hours ago ago
3 comments
You can do an alias.
Good point. TIL :)
git config --global alias.uncommit 'reset --soft HEAD~1'
From "How core Git developers configure Git" https://news.ycombinator.com/item?id=43179071 :
> skwp/git-workflows-book > .gitconfig appendix: https://github.com/skwp/git-workflows-book : > "Two useful aliases: unstage and uncommit": https://github.com/skwp/git-workflows-book#two-useful-aliase... :
[alias] unstage = reset HEAD # remove files from index (tracking) uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
You can do an alias.
Good point. TIL :)
git config --global alias.uncommit 'reset --soft HEAD~1'
From "How core Git developers configure Git" https://news.ycombinator.com/item?id=43179071 :
> skwp/git-workflows-book > .gitconfig appendix: https://github.com/skwp/git-workflows-book : > "Two useful aliases: unstage and uncommit": https://github.com/skwp/git-workflows-book#two-useful-aliase... :