Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Undo, Redo, Change History with Git
Search
Joshua Wehner
January 28, 2015
Programming
160
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
Transcript
17 slides
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
More Decks by Joshua Wehner
See All by Joshua Wehner
How to Undo Almost* Anything in Git
jaw6
0
120
Must It Always Be About Sex?
jaw6
2
210
Other Decks in Programming
See All in Programming
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
120
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
280
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.4k
Apache Airflow Introduction
leew
1
100
joyful-journey-spring-boot.pdf
hollycummins
0
130
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
240
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
470
疎結合とは何か?ソフトウェア設計における結合バランスについて考える #phpcon_niigata
kajitack
2
440
マルチプロダクトSaaSの アプリ一覧を速くする——複数プロダクトにまたがる「権限行脚」を減らすまで #techramen26conf
mktakuya
1
260
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
180
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
410
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
433
67k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
480
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Facilitating Awesome Meetings
lara
57
7.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
890
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
350
The browser strikes back
jonoalderson
0
2k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k