Git reset 命令的使用

到 B 站观看视频

1. 基本概念

http://git-scm.com/2011/07/11/reset.html

2. 我的 .gitconfig

[user]
    name = Peter Wang
    email = happypeter1983@gmail.com
[core]
    editor = vim
[alias]
    ci = commit -a -v
    co = checkout
    st = status
    br = branch
    throw = reset --hard HEAD
    throwh = reset --hard HEAD^
[color]
    ui = true
[push]
    default = current

3. 修理 commit

git reset --soft HEAD^
# edit edit edit 
git commit -a -c ORIG_HEAD

当然也可以使用 git commit --amend

4. 实战演练: implement a new feature

http://blog.hashrocket.com/posts/feature-development-with-git-branching