Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
認証・認可の基本を学ぼう前編
kouyuume
0
200
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
JETLS.jl ─ A New Language Server for Julia
abap34
1
380
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
3k
Developing static sites with Ruby
okuramasafumi
0
270
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
380
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
150
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
430
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
SwiftUIで本格音ゲー実装してみた
hypebeans
0
280
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
tparseでgo testの出力を見やすくする
utgwkk
1
210
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.2k
What's in a price? How to price your products and services
michaelherold
246
12k
Become a Pro
speakerdeck
PRO
31
5.7k
It's Worth the Effort
3n
187
29k
Context Engineering - Making Every Token Count
addyosmani
9
500
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
BBQ
matthewcrist
89
9.9k
GraphQLとの向き合い方2022年版
quramy
50
14k
Why Our Code Smells
bkeepers
PRO
340
57k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
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