Branching & Switching
git switch -c feature/loginCreate and switch to a new branch (modern alternative to checkout -b)
git branch -d branch-nameSafely delete a merged branch
git branch -aList all local and remote branches
Stash & Undoing Changes
git stash push -m 'wip-work'Shelve uncommitted local changes into stash stack
git stash popRestore and pop latest stashed changes back into working tree
git restore --staged <file>Remove a file from staging without altering file contents
git commit --amend --no-editAdd recent edits to the previous commit without changing the commit message
Interactive Rebase & Hygiene
git rebase -i HEAD~3Interactively squash, edit, or reword the last 3 commits
git reflogChronological log of HEAD movements to rescue lost or deleted commits
Amaliy Maslahatlar va Xavfsizlik
Never run `git push --force` directly against shared production branches
Adhere to atomic commits for easier revert and review workflows
Follow Conventional Commits specification (feat:, fix:, chore:)