Regex Cheat Sheet
A searchable quick reference for regex syntax — click any card to copy.
A searchable, filterable reference of common Git commands: setup, branching, remotes, undo, stash, and more.
This is a quick reference for everyday Git commands, organized into 8 categories: setup, basics, branching, remote, undo/reset, stash, history & inspection, and tags. Search and category filters help you find the command you need right away.
All three undo the previous commit, but with different scope. --soft keeps your changes staged, --mixed (the default) unstages them but keeps them in the working directory, and --hard discards the changes entirely.
git merge combines two branches' histories into a single merge commit, preserving the branching history as-is. git rebase reapplies your branch's commits on top of another branch, producing a linear history. Rebasing a shared branch can rewrite history other developers depend on, so use it carefully.
A plain --force unconditionally overwrites whatever is on the remote. --force-with-lease only allows the push if the remote hasn't changed since you last fetched, which helps prevent accidentally wiping out someone else's work.
Use git stash to temporarily shelve in-progress changes so you can switch branches, and use git commit to record a meaningful, permanent unit of change in your history. A stash is a temporary holding area, not part of your permanent history.