Your Git Cheatsheet
93%
Undoing Things
| Command | What It Does |
|---|---|
git restore | Discard uncommitted changes (back to last commit) |
git restore --staged | Unstage a file (keep the changes, just remove from staging) |
git revert HEAD | Create a new commit that reverses the most recent one |
git revert |
Learn Git in a Day
Everything you need, nothing you don'tEnroll now to unlock all content and receive all future updates for free.
Unlock now $9.99$7.49Learn More
Hurry! This limited time offer ends in:
To redeem this offer, copy the coupon code below and apply it at checkout:
