GitGit使用

git单文件版本恢复

2017-02-09  本文已影响76人  EldonZhao
待恢复版本号
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git reset fc7237c8c0e13f20b0be97a57ed2b707e54532c3 app/index.html
Unstaged changes after reset:
M   Browser/app/index.html
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git reset 90b911c98a67237cd9c31ecee74c3bea2dca9767 app/index.html
Unstaged changes after reset:
M   Browser/app/index.html
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git checkout app/index.html
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
    modified:   app/index.html
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git diff app/index.html
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git commit -a
[master 71abf0e] Solve missing amap problem
 1 file changed, 4 insertions(+)
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git push
上一篇 下一篇

猜你喜欢

热点阅读