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
130
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
Agentic Elixir
whatyouhide
0
100
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
130
Making the RBS Parser Faster
soutaro
0
380
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
180
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.3k
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
5k
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
950
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
220
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
240
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
2
180
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
Angular Signal Forms
debug_mode
0
110
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
From π to Pie charts
rasagy
0
160
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Paper Plane (Part 1)
katiecoart
PRO
0
6.7k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
RailsConf 2023
tenderlove
30
1.4k
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
190
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
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