- Find commits by words in their message
git log --oneline -i --grep="login fix"Shows every commit whose message mentions those words, newest first. -i ignores capital letters.
- Find commits that added or removed some code
git log --oneline -S "maxRetries"Shows the commits where that exact text appeared or disappeared in any file. Handy for "when did this line come in?"
- Find commits that changed one file
git log --oneline -- src/app.js - See who last changed each line of a file
git blame src/app.jsEach line shows the commit, the author and the date. Press q to leave.
- Look at one commit in full
git show a1b2c3dCopy the short ID from any of the lists above.
Check it worked
- Search the code as it is now
git grep -n "maxRetries"Shows where that text appears in the current files, with line numbers.
Undo it
- Nothing to undo
git statusSearching only reads the history. It never changes your files or commits.
- Find commits by words in their message
git log --oneline -i --grep="login fix"Shows every commit whose message mentions those words, newest first. -i ignores capital letters.
- Find commits that added or removed some code
git log --oneline -S "maxRetries"Shows the commits where that exact text appeared or disappeared in any file. Handy for "when did this line come in?"
- Find commits that changed one file
git log --oneline -- src/app.js - See who last changed each line of a file
git blame src/app.jsEach line shows the commit, the author and the date. Press q to leave.
- Look at one commit in full
git show a1b2c3dCopy the short ID from any of the lists above.
Check it worked
- Search the code as it is now
git grep -n "maxRetries"Shows where that text appears in the current files, with line numbers.
Undo it
- Nothing to undo
git statusSearching only reads the history. It never changes your files or commits.
- Find commits by words in their message
git log --oneline -i --grep="login fix"Shows every commit whose message mentions those words, newest first. -i ignores capital letters.
- Find commits that added or removed some code
git log --oneline -S "maxRetries"Shows the commits where that exact text appeared or disappeared in any file. Handy for "when did this line come in?"
- Find commits that changed one file
git log --oneline -- src/app.js - See who last changed each line of a file
git blame src/app.jsEach line shows the commit, the author and the date. Press q to leave.
- Look at one commit in full
git show a1b2c3dCopy the short ID from any of the lists above.
Check it worked
- Search the code as it is now
git grep -n "maxRetries"Shows where that text appears in the current files, with line numbers.
Undo it
- Nothing to undo
git statusSearching only reads the history. It never changes your files or commits.

New to Commit? I explain it in plain English on Layman Terms.