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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Joshua Wehner
January 28, 2015
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Undo, Redo, Change History with Git
Undo, Redo and Change History with Git
Joshua Wehner
January 28, 2015
More Decks by Joshua Wehner
See All by Joshua Wehner
How to Undo Almost* Anything in Git
jaw6
0
110
Must It Always Be About Sex?
jaw6
2
200
Other Decks in Programming
See All in Programming
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
210
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
200
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
370
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
550
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
310
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
The NotImplementedError Problem in Ruby
koic
1
850
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
360
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.3k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.3k
さぁV100、メモリをお食べ・・・
nilpe
0
150
Featured
See All Featured
Writing Fast Ruby
sferik
630
63k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
250
A Modern Web Designer's Workflow
chriscoyier
698
190k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
Test your architecture with Archunit
thirion
1
2.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
360
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
150
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
Building the Perfect Custom Keyboard
takai
2
800
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
290
Why Our Code Smells
bkeepers
PRO
340
58k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
210
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