Git Cheat Sheet
Search everyday git commands by what you want to do, including how to undo commits, stashes and merges, and copy each one.
Runs in your browser. Nothing leaves this device.
How to use Git Cheat Sheet
- 1Type what you want to do, such as “undo commit”.
- 2Narrow the list by topic if you like.
- 3Copy the command and replace the parts in angle brackets.
Questions
How do I undo my last commit?
git reset --soft HEAD~1 undoes it and keeps the changes staged. If the commit is already pushed to a shared branch, git revert is safer.
What does “Careful” mean?
Those commands throw away work or rewrite history that others may have pulled. Check git status first.
switch or checkout?
git switch is the newer, clearer command for changing branches. git checkout still works.
Is it free?
Yes. No account, no watermark and no daily limit.
Related tools
- DeveloperBase64 EncoderEncode text or files to Base64 and decode it back, with URL-safe and data URL options.
- DeveloperDiff CheckerCompare two texts and see what was added and removed, line by line or word by word, and download a patch.
- DeveloperHash GeneratorGet the MD5, SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file, and check it against a hash you were given.
- DeveloperJSON FormatterFormat, check and minify JSON, with the exact line of any error.
- DeveloperJWT DecoderRead the header and claims of a JSON Web Token, see when it expires, and check an HMAC signature.
- DeveloperRegex TesterTest JavaScript regular expressions live: every match highlighted, capture groups in a table, and a replace preview.