One useful Git tip is to use the command "git stash", to find the commit that introduced a bug in your code. This command allows you to perform a binary search through your commits to quickly locate the commit that caused the bug.
For example, let's say you have a bug in your code and you know it was not present in a previous version. You can use the command "git bisect" to start the search process:
$ git bisect start
Then you can specify the last known good commit and the current commit where the bug was introduced:
$ git bisect good <good_commit_hash>
$ git bisect bad <bad_commit_hash>
Git will then automatically check out a commit in the middle of the range and ask you if the bug is present or not. Based on your answer, Git will automatically check out the next commit and ask you again. This process will continue until the commit that introduced the bug is found.
Once the bad commit is found, you can use the command
$ git bisect reset
to return to the branch you were working before starting the bisect process.