Cheatsheet: Git
Basic Commands
Initialize a new Git repository
Clone an existing repository
Check repository status
Stage changes for commit
Commit changes
Branching & Merging
Create a new branch
Switch to a branch
Create and switch to a new branch
Merge a branch into the current branch
Delete a branch
Working with Remote Repositories
Add a remote repository
Fetch changes from a remote repository
Pull changes from a remote repository
Push changes to a remote repository
List all remote repositories
Undo & Restore
Undo local changes to a file
Unstage a file
Revert to a previous commit (soft reset)
Revert to a previous commit (hard reset, discards changes)
Remove untracked files
Stashing & Rebasing
Stash uncommitted changes
Apply stashed changes
Create a rebase onto another branch
Continue a rebase after resolving conflicts
Abort an ongoing rebase