
Git Commands Cheat Sheet: The Complete List Every Developer Needs in 2026
Git is the version control system that every developer uses daily — and yet most developers know only 10% of the commands they actually need. This cheat sheet covers the complete set of commands you should actually know. The Essential Daily Commands git status # Full status git add . # Stage all changes git commit -m "message" # Commit with message git push # Upload local commits git pull # Fetch + merge Branching and Merging git branch -a # List all branches git checkout -b new-branch # Create and switch git merge feature # Merge into current branch git rebase main # Rebase onto main Undoing Changes git checkout -- file.txt # Discard working directory changes git reset HEAD file.txt # Unstage file git revert HEAD # Create new commit that undoes last When Stuck: Your Safety Net git stash # Temporarily set aside work git stash pop # Restore stashed work git reflog # Show every HEAD movement git checkout abc123 # Go back to any previous state The Bottom Line Master these commands and you
Continue reading on Dev.to Webdev
Opens in a new tab




