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
Joshua Wehner
January 28, 2015
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
テーブルをDELETEした
yuzneri
0
140
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.7k
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
870
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
180
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
yield再入門 #phpcon
o0h
PRO
0
990
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
160
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
240
Google Apps Script で Ruby を動かす
kawahara
0
140
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
210
FDEが実現するAI駆動経営の現在地
gonta
2
270
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
230
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
480
Measuring & Analyzing Core Web Vitals
bluesmoon
9
950
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
340
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
ラッコキーワード サービス紹介資料
rakko
1
4.3M
Designing for Performance
lara
611
70k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Optimizing for Happiness
mojombo
378
71k
Raft: Consensus for Rubyists
vanstee
141
7.6k
HDC tutorial
michielstock
2
790
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