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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Joshua Wehner
January 28, 2015
Programming
140
0
Share
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
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
140
cloudnative conference 2026 flyle
azihsoyn
0
170
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
130
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
680
20260514_its_the_context_window_stupid.pdf
heita
0
880
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.7k
AgentCore Optimizationを始めよう!
licux
3
230
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
340
when storing skills in S3 file
watany
3
1.5k
書き換えて学ぶTemporal #fukts
pirosikick
2
370
認証統合から始めるフロントエンドの機能単位開発 — マイクロサービス思想の適用
koukimiura
0
100
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
240
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
360
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
210
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
The Cult of Friendly URLs
andyhume
79
6.9k
My Coaching Mixtape
mlcsv
0
120
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
370
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Building Adaptive Systems
keathley
44
3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
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