Question: We are using JIRA and Github together. Now we found out some code we can see in the JIRA tickets has already been pushed to Github at sometime before, and we can click on link, it goes to Github and we can see the changes we made there. But all the code are not in our current branches. And even I go to the local projects to find the file, right click -> show log (tortoiseGit), that ticket and push record is not in the log... I switched to all the branches try to find that record, but I just can't find it anywhere. 

I have the commit hash, I checkout the code with that hash, I can see the changes are back, but it is just not in any of our current branches. I don't know what happened, did anyone got this issue before, how can I get all these code back to the current branches...

Answer: 
You can simplify your search:

```
git branch --remote --contains <commit-id>

```

(See [How to list branches that contain a given commit?](https://stackoverflow.com/questions/1419623/how-to-list-branches-that-contain-a-given-commit))

To get those changes, you can merge that commit into a working branch (`git merge <commit-id>`).

As VonC suggests, rebases or forced deletion are the most likely causes.
It can happen when:

* you rebase a branch, which rewrites all the sha1 (you keep the old sha1 in your reflogs)
* you delete a branch (and push the deletion of that branch)
* you [`merge --squash` a branch](https://stackoverflow.com/a/2427520/6309) in (for instance) `master`, and then delete that branch locally

If you can locally checkout with that SHA1, at least you can create a local branch starting from said SHA1, and push it back.