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
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
340
コードに語らせよう――自己ドキュメント化が内包する楽しさについて / Let the Code Speak
nrslib
6
1.4k
從零到一:搭建你的第一個 Observability 平台
blueswen
1
870
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
790
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
1
530
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
110
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
110
Passkeys for Java Developers
ynojima
2
840
Java on Azure で LangGraph!
kohei3110
0
110
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
350
漸進。
ssssota
0
1.9k
F#で自在につくる静的ブログサイト - 関数型まつり2025
pizzacat83
0
290
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Fireside Chat
paigeccino
37
3.5k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
GitHub's CSS Performance
jonrohan
1031
460k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
780
Into the Great Unknown - MozCon
thekraken
39
1.8k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
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