Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Undo, Redo, Change History with Git
Search
Joshua Wehner
January 28, 2015
Programming
0
120
Undo, Redo, Change History with Git
Undo, Redo and Change History with Git
Joshua Wehner
January 28, 2015
Tweet
Share
More Decks by Joshua Wehner
See All by Joshua Wehner
How to Undo Almost* Anything in Git
jaw6
0
96
Must It Always Be About Sex?
jaw6
2
190
Other Decks in Programming
See All in Programming
SQL Server ベクトル検索
odashinsuke
0
140
Develop Faster With FrankenPHP
dunglas
2
2.9k
Do Dumb Things
mitsuhiko
0
370
フロントエンドテストの育て方
quramy
11
2.8k
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
1
390
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.4k
私の愛したLaravel 〜レールを超えたその先へ〜
kentaroutakeda
12
3.7k
Productivity is Messing Around and Having Fun
hollycummins
0
170
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
1.4k
php-fpm がリクエスト処理する仕組みを追う / Tracing-How-php-fpm-Handles-Requests
shin1x1
5
890
ミリしらMCP勉強会
watany
4
670
gen_statem - OTP's Unsung Hero
whatyouhide
1
180
Featured
See All Featured
Faster Mobile Websites
deanohume
306
31k
Thoughts on Productivity
jonyablonski
69
4.5k
What's in a price? How to price your products and services
michaelherold
245
12k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
8
720
Automating Front-end Workflow
addyosmani
1369
200k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.7k
Gamification - CAS2011
davidbonilla
81
5.2k
It's Worth the Effort
3n
184
28k
Site-Speed That Sticks
csswizardry
4
460
Unsuck your backbone
ammeep
670
57k
Documentation Writing (for coders)
carmenintech
69
4.7k
Transcript
Undo, Redo Change History with Git
Joshua Wehner • @jaw6 •
[email protected]
• Minneapolis, MN, USA
• GitHub Training
Undo & Redo Scenarios
Undo "Public" Change • It's broken • But it's pushed
• git revert <sha>
Tweak Last Commit • Oooops • Committed too fast •
git commit --amend
Regrets, I've Had a Few • Ooooops • That's mostly
rubbish • git reset <last good sha>
Throw It All Away • It's all rubbish • I
regret everything • git reset --hard <last good sha>
Wait, On Second Thought • Throw It All Away •
Could I maybe get that back? • git reflog git reset --hard <sha>
Well, That Wasn't So Bad • Most of that is
trash • But that one? That one is good. • Gimme. • git cherry-pick <good one>
Put That Thing Over There • I should have made
this branch earlier • Those commits should not be on master • git rebase master
None
None
Well, Then Again • Throw It All Some of It
Away • I regret that one thing • Some of the rest of it was okay • git rebase -i <public sha>
I Was Wrong Before • I thought I was wrong
• But I wasn't • git commit --fixup <sha> git rebase -i --autosquash
Forget I Said That • Stop tracking this file •
I mean it • git rm --cached .gitignore git clean -f (also -x maybe?)
Thank you! Undo, Redo, Change History • @jaw6 •
[email protected]
• http://training.github.com/
I'm Only (Sort of) Kidding • Commit part (just part)
of a file • git add -p