{}const=>[]async()letfn</>var
Development

Git tricks you didn't know about: cherry-pick, bisect, and 3 more

We analyze 5 advanced git commands that help out in the most unexpected situations. Be like a senior — use bisect, reflog and other techniques

К

Kodik

Author

2 min read

🍒 git cherry-pick: steal a commit quietly

Want to take one specific commit from another branch without merging everything? Here's your friend:

git cherry-pick <хеш-коммита>

💡 It is useful when the bug has already been fixed in dev, but not yet in main.

🔥 100,000+ students already with us

Tired of reading theory?
Time to code!

Kodik — an app where you learn to code through practice. AI mentor, interactive lessons, real projects.

🤖 AI 24/7
🎓 Certificates
💰 Free
🚀 Start learning
Joined today

🕵️ git bisect: find a bug without burning

A bug appeared — but when? bisect will show you where everything broke:

git bisect start
git bisect bad          # current version with bug
git bisect good <hash>  # old version without bugs

Git itself switches branches and prompts: "Check this." You answer good or bad — and it goes on until it finds the culprit.

💥 git reflog: remote resuscitation

Removed the branch, dropped the commits, did a reset — and panic? Calm down:

git reflog

Git remembers everything. You will find the necessary commit and restore it with:

git checkout <hash>

🧼 git clean: clean up the garbage

The node_modules folder, temporary files, and cache can all be deleted:

git clean -fd
  • -f — force

  • -d — directories too

It is useful before a push or build.

🧪 git stash: hide changes

When you urgently need to switch to another branch, but the current changes are not ready:

git stash

And then:

git stash pop

🧠 Temporary change storage is convenient when the code is in progress, and you are pulled to a hotfix.

📌 Conclusion

These commands are not well-known to beginners, but they are often used by mid-level and senior users. Master them and Git will become your ally, not your enemy.

💬 Want more git tricks? Write in the comments or check out Kodik Telegram Community - there we share insights, solve problems and learn together.

🎯Stop procrastinating

Liked the article?
Time to practice!

In Kodik, you don't just read — you write code immediately. Theory + practice = real skills.

Instant practice
🧠AI explains code
🏆Certificate

No registration • No card