-
確認(rèn)需要恢復(fù)的版本號:
待恢復(fù)版本號
-
恢復(fù)文件到對應(yīng)版本:
eldon@ubuntu:~/github/ColusLifeDemo/Browser$ git reset fc7237c8c0e13f20b0be97a57ed2b707e54532c3 app/index.html
Unstaged changes after reset:
M Browser/app/index.html
-
確認(rèn)恢復(fù)內(nèi)容:
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