Two ways to search history commits, depend on what you remember.
By commit message
git log --grep="variables" --oneline
Only commits whose message match the word:

By code change
git log -S "variables" --oneline -- src/
-S: find commits that added or removed the string-- src/: limit to a path
Find the commit that introduce or remove the code:

add -p to see the diff too.
See you again ^_^