Hegwin.Me

The bitterest tears shed over graves are for words left unsaid and deeds left undone.

How to undo a git reset hard and branch delete

Git 找回reset --hard的代码及删除的分支

People make mistakes all the time. I remember the first time I used `git reset --hard` + `git push -f` was in early 2013. I thought it was just a small commit, but I ended up pushing a bunch of useless code to github. What should I do? At this time, some seniors came out and told me that even...

Git Squash Last Commits

Git 合并最后若干次提交

When people are working on features locally, sometimes a git commit is executed once a part of a feature is completed, which makes it easier to trace issues. But in a team, small, multiple commits are not very friendly to the rest of the team. So when we finally push code to the server or merge it into a master...

Git amend last commit

Git修改上一次提交

No one is immune to mistakes. Sometimes after a git commit, you may find something missing. At this point, if we haven't already pushed, we can use amend to change the last commit more easily. If you're just modifying the commit message, you can just change the text in your editor for git and then save it to close. If...