DEV Community

Cover image for 10 Git Commands You’ll Wish You Knew Earlier

10 Git Commands You’ll Wish You Knew Earlier

Sylwia Laskowska on August 26, 2026

Do you know Git? Of course you do! Today, I’ve got a few of my favorite Git commands for you. When I was a junior developer, my tech lead...
Collapse
 
pengeszikra profile image
Peter Vivo

A best how to use git short document!

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Ooooh, thank you so much! ☺️ Now I can just send this article to juniors instead of explaining all of this on a call every time. 😂

Collapse
 
pengeszikra profile image
Peter Vivo

Thats why is working so well

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Hahahaha, should've written this a few years ago! 😅

Collapse
 
anchildress1 profile image
Ashley Childress

This is exactly how I started writing! So I didn't have to explain myself multiple times. 😂 Great article!

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Thank you so much! 😄 Haha, I also wrote a few articles specifically for my juniors. But then somehow this whole writing thing took a rather unexpected turn. 😂

Collapse
 
buildbasekit profile image
buildbasekit

Hi Sylwia! 😂

git reflog is basically Git’s emergency contact. You hope you never need it, but the moment you accidentally nuke two days of work, suddenly it’s your best friend.

Now I’m curious: which Git command has saved you from the biggest disaster so far? 😄

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Haha, that’s a good question! 😄 I’d say git revert has definitely saved me from the biggest disasters. git reflog can save your work, sure, but git revert can save production. 😂

Collapse
 
sandrog profile image
Sandro Garcia

You're making me feel old! When I was a junior, Git didn't even exist. I started back in the day with Visual SourceSafe 6.0, then moved to SVN (good old TortoiseSVN), until Microsoft eventually pushed everyone to TFS.

I only really made the jump to Git around 2019 when I joined Bloomberg, and only switched my personal projects to it about two years ago after sticking with the MS ecosystem for ages.

Great list of commands, by the way. My favorite: cherry-pick!

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thank you so much, Sandro! And yes, that’s true, especially with older projects, SVN managed to stick around for years and years.

I’ve actually worked with Git since the very beginning of my career, but here’s the plot twist: I used TortoiseGit. 😂 As far as I remember, it was basically the Git-enabled cousin of TortoiseSVN. So apparently our Git histories crossed paths after all! 😄