How do I pull a single commit from GitHub
I've been Googling this but don't understand other's answers as I am new to git/Github.
I made some changes to a few files on a large project and pushed to GitHub. I then must have updated and pulled an older version and so lost all my changes.
I can still see my changes/commits on GitHub. How do I grab these and 'merge'(?) them back onto my local directories?
EDIT:
OK this is even weirder. These files seem to appear and dissappear on my local when I change branches. Is there anyway to have the modified files from all branches available at the same time?
You probably should get a merge tool to help you resolve git conflicts, and make it easy to manage your repository.
Check this question about git merging
First of all, the beauty of git/github is that you never lose anything.
git log
for viewing your commit history git revert
to jump back to the commit that contains the changes that you want to get to. I found the problem was that when I switched branches there was an automated script that would update and merge that branch with files form the production server.
This seems fine, but since stuff I'd made on other branches wasnt in the production server or my current branch's repo everytime I would switch branches I would lose files from other branches.
Apparently the only way to get around this is to copy paste files from one branch to another or hold off work until it's commit to production. Not the way I would have thought, but there you go.
链接地址: http://www.djcxy.com/p/18860.html上一篇: 如何调和分离的头部和起源/主人? 已经签出旧的散列
下一篇: 我如何从GitHub提交一个提交