Loading…

How to use Git Cheatsheet

Search or browse grouped Git commands to find the exact syntax for tasks like committing, branching, rebasing or undoing changes, with a short note on each.

Frequently asked questions

How do I undo the last commit but keep changes?

Use git reset --soft HEAD~1, which moves the branch back one commit while leaving your changes staged.

What is the difference between merge and rebase?

Merge preserves history with a merge commit; rebase replays your commits onto another branch for a linear, cleaner history.

How do I discard local changes to a file?

git checkout -- file (or git restore file) reverts the file to the last committed state, discarding uncommitted edits.

More Developer Tools

Linux Commands Ref
Search Linux commands + examples.
Regex Cheatsheet
Regex patterns with live test.
HTTP Headers Ref
Common request/response headers.
Color Names Ref
CSS named colors palette.
Lorem Ipsum Advanced
Words/sentences/paragraphs generator.
Hash Generator Advanced
MD5/SHA1/SHA256/SHA512 side-by-side.
Color Gradient CSS
Linear/radial/conic gradient generator.
Box Shadow Generator
Live CSS box-shadow preview.
Text Shadow Generator
Live CSS text-shadow preview.
Border Radius Generator
Independent corner radius controls.
Flexbox Generator
Visual flex layout + CSS code.
Grid Generator
Visual grid layout + CSS code.

← View all Developer ToolsBrowse all 1,100+ tools →