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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
110
Must It Always Be About Sex?
jaw6
2
200
Other Decks in Programming
See All in Programming
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
220
AI 開発合宿を通して得た学び
niftycorp
PRO
0
150
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.5k
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
220
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
410
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
300
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
270
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
610
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
へんな働き方
yusukebe
4
2.6k
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
Featured
See All Featured
Claude Code のすすめ
schroneko
67
220k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
sira's awesome portfolio website redesign presentation
elsirapls
0
190
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
340
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
Google's AI Overviews - The New Search
badams
0
930
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
Optimizing for Happiness
mojombo
378
71k
30 Presentation Tips
portentint
PRO
1
250
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