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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Joshua Wehner
January 28, 2015
Programming
0
130
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
110
Must It Always Be About Sex?
jaw6
2
200
Other Decks in Programming
See All in Programming
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.3k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
Architectural Extensions
denyspoltorak
0
290
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
210
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
SourceGeneratorのススメ
htkym
0
200
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
190
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Featured
See All Featured
A Tale of Four Properties
chriscoyier
162
24k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
The Curious Case for Waylosing
cassininazir
0
240
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Speed Design
sergeychernyshev
33
1.5k
KATA
mclloyd
PRO
34
15k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
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