My colleague did a change a while back - introduced a new function - and that was (sucessfully) committed to git. Now, though, that function has gone missing.
git log --reverse
Because your history has already been pushed, the best way is to make a new commit. Otherwise, you run the risk of losing other code and messing up everyone's repos.
Since you know where the commit that last has the function, you can
git checkout 48d60a03 -- <name of file with function>. Then you can commit the old/new file with the function.
As there are likely to be other changes in the file, you will probably want to
git reset to unstage the file and use
git add -p to only add the changes for the function that you are looking for.
For preventing this from happening, my recommendation is to get a comprehensive test suite that you can run after completing a merge. That can help minimize the chances that code will be lost as tests will fail.