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
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
38
26k
React Native New Architecture 移行実践報告
taminif
1
150
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
2
220
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
320
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
430
AIコーディングエージェント(NotebookLM)
kondai24
0
180
sbt 2
xuwei_k
0
290
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
820
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
170
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
8
5.6k
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
160
Featured
See All Featured
Faster Mobile Websites
deanohume
310
31k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
How GitHub (no longer) Works
holman
316
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Into the Great Unknown - MozCon
thekraken
40
2.2k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
100
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Cult of Friendly URLs
andyhume
79
6.7k
Optimizing for Happiness
mojombo
379
70k
Statistics for Hackers
jakevdp
799
230k
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