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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
Unity6.3 AudioUpdate
cova8bitdots
0
120
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
270
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
530
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
120
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
190
Codex の「自走力」を高める
yorifuji
0
1.2k
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
260
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
530
AHC061解説
shun_pi
0
360
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
130
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
380
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
420
Featured
See All Featured
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
99
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Building Applications with DynamoDB
mza
96
7k
WCS-LA-2024
lcolladotor
0
480
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
The Language of Interfaces
destraynor
162
26k
Building an army of robots
kneath
306
46k
Technical Leadership for Architectural Decision Making
baasie
3
280
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
300
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