Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

git reset HEAD^

Add --hard, --mixed, --soft for different effects. This command itself can be undone by going through git reflog and finding the appropriate commit.



To add to this, git-reset enables much more than simply 'undoing' the last commit, so it could not be adequately replaced with `git commit --undo`.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: