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
93
Must It Always Be About Sex?
jaw6
2
180
Other Decks in Programming
See All in Programming
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
630
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
Beyond ORM
77web
11
1.6k
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
250
Azure AI Foundryのご紹介
qt_luigi
1
210
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
為你自己學 Python
eddie
0
520
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
180
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
200
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
2.7k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
950
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Become a Pro
speakerdeck
PRO
26
5.1k
Scaling GitHub
holman
459
140k
Site-Speed That Sticks
csswizardry
2
270
Designing for Performance
lara
604
68k
Why Our Code Smells
bkeepers
PRO
335
57k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
How to train your dragon (web standard)
notwaldorf
89
5.8k
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