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
99
Must It Always Be About Sex?
jaw6
2
190
Other Decks in Programming
See All in Programming
仕様がそのままテストになる!Javaで始める振る舞い駆動開発
ohmori_yusuke
8
4.5k
CSC509 Lecture 13
javiergs
PRO
0
250
2025 컴포즈 마법사
jisungbin
0
130
JJUG CCC 2025 Fall: Virtual Thread Deep Dive
ternbusty
3
460
モデル駆動設計をやってみよう Modeling Forum2025ワークショップ/Let’s Try Model-Driven Design
haru860
0
160
CloudflareのSandbox SDKを試してみた
syumai
0
170
flutter_kaigi_2025.pdf
kyoheig3
1
340
r2-image-worker
yusukebe
1
170
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
2
3.4k
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
150
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
2
2.1k
CloudNative Days Winter 2025: 一週間で作る低レイヤコンテナランタイム
ternbusty
7
1.5k
Featured
See All Featured
The Language of Interfaces
destraynor
162
25k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
GitHub's CSS Performance
jonrohan
1032
470k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
We Have a Design System, Now What?
morganepeng
54
7.9k
Facilitating Awesome Meetings
lara
57
6.6k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Bash Introduction
62gerente
615
210k
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