如何从当前状态恢复为在某个提交时创建的快照?
如果我这样做git log,那么我得到以下输出:
$ git log
commit a867b4af366350be2e7c21b8de9cc6504678a61b`
Author: Me <me@me.com>
Date: Thu Nov 4 18:59:41 2010 -0400
blah blah blah...
commit 25eee4caef46ae64aa08e8ab3f988bc917ee1ce4
Author: Me <me@me.com>
Date: Thu Nov 4 05:13:39 2010 -0400
more blah blah blah...
commit 0766c053c0ea2035e90f504928f8df3c9363b8bd
Author: Me <me@me.com>
Date: Thu Nov 4 00:55:06 2010 -0400
And yet more blah blah...
commit 0d1d7fc32e5a947fbd92ee598033d85bfc445a50
Author: Me <me@me.com>
Date: Wed Nov 3 23:56:08 2010 -0400
Yep, more blah blah.
Run Code Online (Sandbox Code Playgroud)
如何从11月3日恢复提交,即提交0d1d7fc?
我有一个服务器,其中有一些配置,我不知道我只是git pull,它获取github仓库中的内容,然后重新启动它以便部署.
问题是,有一个不是我最新的提交,实际上并不在我的服务器上.这些文件不在.gitignore中.我如何确保拉动,拉动提交?
我真的不知道如何解决它,我正在考虑重新启动一切:(
14:41][root@someserver] someserver_dir (master)$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: Gemfile
# modified: Gemfile.lock
# modified: config/assets.yml
# modified: config/database.yml
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# randomfiles
Run Code Online (Sandbox Code Playgroud)