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
0
120
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
96
Must It Always Be About Sex?
jaw6
2
190
Other Decks in Programming
See All in Programming
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
790
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
200
コードに語らせよう――自己ドキュメント化が内包する楽しさについて / Let the Code Speak
nrslib
6
1.4k
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
110
単体テストの始め方/作り方
toms74209200
0
430
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
130
統一感のある Go コードを生成 AI の力で手にいれる
otakakot
0
2.9k
インターフェース設計のコツとツボ
togishima
2
700
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfold' relates to 'iterate'"
philipschwarz
PRO
0
190
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
280
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
120
エラーって何種類あるの?
kajitack
5
140
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
6
690
What's in a price? How to price your products and services
michaelherold
245
12k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
How GitHub (no longer) Works
holman
314
140k
We Have a Design System, Now What?
morganepeng
52
7.6k
The Language of Interfaces
destraynor
158
25k
Adopting Sorbet at Scale
ufuk
77
9.4k
Automating Front-end Workflow
addyosmani
1370
200k
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