Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
130
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
100
Must It Always Be About Sex?
jaw6
2
190
Other Decks in Programming
See All in Programming
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
430
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
140
tparseでgo testの出力を見やすくする
utgwkk
2
250
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
3
1.2k
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
370
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
130
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
開発に寄りそう自動テストの実現
goyoki
2
1.2k
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
250
FluorTracer / RayTracingCamp11
kugimasa
0
240
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
130
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.3k
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
1
200
RailsConf 2023
tenderlove
30
1.3k
What's in a price? How to price your products and services
michaelherold
246
13k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
310
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
110
Statistics for Hackers
jakevdp
799
230k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
180
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
130
The SEO Collaboration Effect
kristinabergwall1
0
300
Crafting Experiences
bethany
0
18
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
83
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