简体   繁体   English

Git拉取请求-如何拉取和更新Sublime

[英]Git pull request - how to pull and update Sublime

I've made a stupid error which has messed up my database on a Rails App I'm working on. 我犯了一个愚蠢的错误,弄乱了我正在使用的Rails应用程序上的数据库。 Luckily I'm on a branch and haven't committed any changes so the version on Git is in working order. 幸运的是,我在一个分支上,还没有进行任何更改,因此Git上的版本处于正常工作状态。

How do I now pull through the Git version and update to Sublime so I can carry on working as if nothing happened? 现在我该如何浏览Git版本并更新到Sublime,这样我就可以继续工作,好像什么都没发生一样? I've just done git pull origin master but it says up to date so I've obviously done something wrong. 我刚刚做过git pull origin master,但是它说的是最新的,所以我显然做错了。 I'm not keen on a db:drop so I'd rather do it this way if possible. 我不喜欢db:drop,所以如果可能的话我宁愿这样。

git checkout 01h5y77d (find this in git, a version of the app which works)

这将打印“ HEAD now at 01h5y77d ...”,您不必提交,因为您尚未提交错误:)

You can't pull again, because you already pulled every commit from your remote. 您不能再拉,因为您已经从远程拉出了所有提交。

Add changes, stash them, remove the stash: 添加更改,存储它们,删除存储:

git add --all && git stash && git stash drop

This will remove every uncommited change and bring you back to the latest commit on the current branch. 这将删除所有未提交的变化,把你带回了最新提交的当前分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM