Settings

Theme

Show HN: Git uncommit – reset unpushed, committed changes

github.com

3 points by below43 a month ago · 4 comments · 1 min read

Reader

Equivalent of "git reset --soft HEAD~1". Got sick of googling it every time with my goldfish memory.

Just a brew package at this point, but feel free to suggest alternatives.

westurner a month ago

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
myst a month ago

You can do an alias.

  • below43OP a month ago

    Good point. TIL :)

    git config --global alias.uncommit 'reset --soft HEAD~1'

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection